JSFiddle - React, Tailwind, and code Playground

by ravatsinh

HTML

<table style="width: 100%;" id="new-urls">
				<tbody><tr class="headerRow">
				<th>Status</th>
				<th>Url</th>
				</tr>
		<tr>
						<td>111</td>
						<td>1112</td>
</tr>
				<tr class="headerRow">
				<th>Status</th>
				<th>Url</th>
				<th>Entryfee_dt</th>
</tr>
		<tr>
            <td>3233</td>
            <td>3233</td>
						<td>3233</td>
                    </tr>
</tbody></table>

JavaScript

$("tr").click(function() {
    alert($(this).closest('tr[class=headerRow]').html());
    alert($(this).closest('tr').find('[class=headerRow]').html());
    alert($(this).siblings('.headerRow').html());
    alert($(this).closest('tr').prev('tr[class="headerRow"]').html());
});