JSFiddle - React, Tailwind, and code Playground

by srhcan

HTML

<table id="resultTable" border="1">
    <tr id="first">
        <td>c1</td>
        <td>c2</td>
    </tr>
    <tr id="second">
        <td>c3</td>
        <td>c4</td>
    </tr>
</table>

JavaScript

$(document).ready(function () {      
     $('#resultTable tr').click(function (event) {
          alert($(this).attr('id')); //trying to alert id of the clicked row          

     });
 });