I need to set the input value using the following way
<table width="50%" border="0" id="pls-batting">
<tr id="1">
<td>
<input name="in" type="text" value="5">
</td>
</tr>
<tr id="2">
<td>
<input name="in" type="text" value="">
</td>
</tr>
</table>
value = $("table#pls-batting tr:nth-child(1) td:nth-child(1)").children().val();
When I alert the value it returns ‘5’. It is well and good. Similarly I need to set the value to input field for the 2nd row. I use the following code
$("table#pls-batting tr:nth-child(2) td:nth-child(1)").children().val='test';
But it is not working. Is there any way to set the value using the children() method or by using row ID?
Try this…
or you can try some other way