jquery - how to get input text value from inside td
Posted
by Ashish Rajan
on Stack Overflow
See other posts from Stack Overflow
or by Ashish Rajan
Published on 2010-03-30T15:25:32Z
Indexed on
2010/03/30
15:33 UTC
Read the original article
Hit count: 1173
jQuery
<tr>
<td>
<input type="text" name="duration[]">
</td>
<td>
<input type="text" name="start[]">
</td>
<td>
<input type="text" name="wait[]">
</td>
<td>
<input type="text" name="end[]">
</td>
</tr>
I have such multiple rows. I need to fetch the values off all tds on keyup event on the td with input name start. Since they are many i cannot go with ids, need help in parent child approach with jquery.
I was able to reach parent tr on keyup event on the above mentioned td but not able to access values of input field in other tds. the jquery code i used
$(document).ready(function(){
$(".start").keyup(function(){
alert($(this).parent().get(-3).tagName);
})
});
© Stack Overflow or respective owner