how can i get the value of the type=hidden when i click the <tr class='click'>?
i only get the value of first hidden and when i click the other <tr> the same value from first hidden.
jquery code
$(document).ready(function(){
$('tr[class='click']').click(function(){
var a= $('tr[class='click'] input:hidden').val();
alert("a");
});
});
html code
<table id='tbform'>
<tr class='click'>
<td><input type='hidden' id='txtval' value='1' name='txtval[]' ></td>
</tr>
<tr class='click'>
<td><input type='hidden' id='txtval' value='2' name='txtval[]' ></td>
</tr>
<tr class='click'>
<td><input type='hidden' id='txtval' value='3' name='txtval[]' ></td>
</tr>
</table>