here is my code :
<table><tr><td>hello</td>
<td><input type="text" value="0" onkeypress="GetValue();" /></td>
<td><input type="text" value="15" /></td>
</tr>
</table>
<script type="text/javascript">
function GetValue(){
// ???
}
</script>
how can i access the value of the third td ( the td with the value 15 )
without using the the easy way and give the td an id and call it i want by using .parent() or .siblings() this is a simple example to simplify my work but in my actual project the input have their value binded from DB and it’s much more complicated any help apreciated
You can do it via the :nth-child() selector.
JS code:
DEMO