Getting the value for a text string

Getting the value for a text string

I have the following HTML table

  1. <tr><td align="right"><span class="jqSelector">1234</span></td></tr>
  2. <tr><td align="right"><span class="jqSelector">4567</span></td></tr>

and separate form

  1. <input type="number" id="NumberField">

I want to use something like

  1. $(".jqSelector").click(function(){
  2. $("#NumberField").val(this.val());
  3. $("#NumberField").focus();
  4. });

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?