** EDIT** I’m very sorry. I need the td index, not the row index.
Using jQuery, how do I get the index of the td lblName is in?
<table>
<tr>
<td>
</td>
<td>
<label id="lblName" />
</td>
<td>
</td>
</tr>
</table>
Update for updated question:
or
Original answer:
Use
.index().The
.index()method has a few different use patterns.This one means “take the first element matched by the selector, and return its zero based index of its position among its siblings”.
Or natively, do this…
Or combine the two…