JSFiddle - React, Tailwind, and code Playground
HTML
<table class="mytable">
<tr id="1" onclick = "try(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);
});*/
function try(x)
{
alert('12345');
//alert( this.getElementsByTagName('td')[0].innerText));
}