JSFiddle - React, Tailwind, and code Playground

by chhameed

HTML

<table class="mytable">
          <tr id="1">
              <td>John</td>
              <td>123</td>
          </tr>
           <tr id="2">  
              <td>Kate</td>
              <td>456</td>
          </tr>
      </table>

JavaScript

$('.mytable tr').click(function(e){
                   var rowId = $(this).attr('id');
               alert(rowId);
  });