JSFiddle - React, Tailwind, and code Playground

HTML

<table>
    <tr>
        <td>
            <input type="button" name="test" value="Edit" id="amol" />
        </td>
    </tr>
</table>

JavaScript

$(document).ready(function () {
    $("table tr").click(function () {
        alert(this.rowIndex); // alert the index number of the clicked row.
    });
});