Here is the HTML code that I copied/pasted using Firebug:
<div id="TBI">
<tr class="t-state-selected t-grid-edit-row">
<td>8081</td>
<td class="t-grid-edit-cell">
<input id="ijn" class="text-box single-line valid" type="text" value="" name="ijn">
</td>
I'm able to access the 2nd cell of this table using the following:
$('#TBI tr.t-state-selected')[0].cells[1]
and all works well.
But, how can I get a jquery reference to the input that is contained within the TD? Once I figure out how to get a selector for that text box, I can manipulate it as I wish.
Thanks ahead of time for help!
Just try:
$("#TBI tr.t-state-selected input")
Or for the input inside the second td:
$("#TBI tr.t-state-selected:nth-child(1) input");
Demo: Fiddle
$('#TBI tr.t-state-selected td input')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With