I have a table. Each row has an ID.
Can I get the index of any row by using only its ID (no click) and without using a loop?
My HTML looks like this:
<table id="tabId">
<tr id="a">
<td>ss</td>
<td>ss</td>
</tr>
<tr id="b">
<td>kk</td>
<td>kk</td>
</tr>
I tried this:
var row_number = document.getElementById('a').rowIndex;
but it's not working; I get an error message saying:
[ts] Property 'rowIndex' does not exist on type 'HTMLElement'.