In my HTML table, each row has a separate identifier. Each row has a column containing a button. I can record the event of pressing these buttons. Is there a way to get the corresponding row id in the click event of this button
An example table is shown below.
<table>
<tr id="1">
<td> <input type="image" id="Bttn_play" src="../../Content/images/play_button.png" name="image" /> </td>
<td> test dat1a</td>
</tr>
<tr id="2">
<td> <input type="image" id="Bttn_play" src="../../Content/images/play_button.png" name="image" /> </td>
<td> test data2</td>
</tr>
</table>
I can capture a button click event using the following jQuery
$("#Bttn_play").live('click', function (event) {
alert (row id);
}
source
share