html code :
<tr id="myname">
<td><input class="count" type="text" value="1"></td>
</tr>
jquery code :
$('input.count').keyup(function(e){
var test = $(this).parent().parent().attr('id');
alert(test);
});
when keyup input , get tr id !
You could try the closest() method in jQuery:
Here’s a working example: DEMO
What’s different is that you haven’t provided the
<table></table>tags.