i have a table like this
<table>
<tr id ='1tr'>
<td><input type='textbox' value='1'></td>
<td><input type='textbox' value='2'></td>
</tr>
<tr id ='2tr'>
<td><input type='textbox' value='3'></td>
<td><input type='textbox' value='4'></td>
</tr>
</table>
how i can get the value of text box in second td that is in tr with id 2tr
Try this code:
$('#1 input').val();
New code after your edit in your answer
$('#2tr td:eq(1) input').val();
is what you want?
There is no textbox in tr with id '1', so I guess you wnat this one out of tr with id '2'...
You can write:
$('#2 td input').val()
But it is not recommended to use number as ID in an HTML-DOM!
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