I have a dynamically created table as:
<div id="gameListDiv">
<table id="gameListTable">
<tr id="1">
<td>A</td>
<td>B</td>
<td class="tpButton">C</td>
</tr>
<tr id="2">
<td>D</td>
<td>E</td>
<td class="tpButton">F</td>
</tr>
</table>
</div>
I have a listener:
$('#gameListDiv').on('click','.tpButton', function(toggleThisTP) {
// If user clicks C, return the row ID of '1'
// if user clicks F, return the row ID Of '2'
});
As in the code comments just above, how to I get the value if the ID tag of the specific row when the user clicks a cell in the 3rd column of the table?
This should work:
Link to closest() documentation