JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<table>
<html>
<tr id="tr1">
<td>
<button>
Hello
</button>
</td>
</tr>
<tr id="tr2">
<td>
<button>
Hello2
</button>
</td>
</tr>
</table>
JavaScript
$("button").click(function(event) {
alert($(this).closest("tr").attr("id"));
});