Getting the value for a text string
I have the following HTML table
- <tr><td align="right"><span class="jqSelector">1234</span></td></tr>
- <tr><td align="right"><span class="jqSelector">4567</span></td></tr>
and separate form
- <input type="number" id="NumberField">
I want to use something like
- $(".jqSelector").click(function(){
- $("#NumberField").val(this.val());
- $("#NumberField").focus();
- });
To set the form field to the clicked value and focus the field. As I understand it the .val() won't work here, but will anything else? Can I even select the "1234" without it being in a form field?