I am new to jQuery, so hopefully there is a simple answer to this question.
I have an html similar to:
<table id="dataTable"> <tr> <td>...</td> <tr> <tr> <td> <table> <tr> <td>...</td> </tr> </table> </td> <tr> </table>
I am using jQuery similar to this:
$("#dataTable tr").length;
I expect the length to be 2, but 3 is returned (includes <tr> in the nested table). My question is: How to prevent the 3rd <tr> from choosing?
I know that I could add the ignorethisrow class to the last line and exclude this from my results, but I would prefer the option that allows me to control the depth that the selector searches for.
source share