I need to set the input value using the following method.
<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 warn the value, it returns "5". This is good and good. Similarly, I need to set the value for the input field for the second row. I am using the following code
$("table#pls-batting tr:nth-child(2) td:nth-child(1)").children().val='test';
But it does not work. Is there a way to set the value using the children() method or using the string id?
source share