I’ve got this html:
<table>
<tr style="display:table-row"><td>blah</td></tr>
<tr style="display:none"><td>blah</td></tr>
<tr style="display:none"><td>blah</td></tr>
<tr style="display:table-row"><td>blah</td></tr>
<tr style="display:table-row"><td>blah</td></tr>
</table>
I need to count the number of rows that don’t have display:none. How can I do that?
You can use the
:visibleselector and.lengthlike this:If the
<table>itself isn’t visible on the screen (:visiblereturns false if any parent is hidden, the element doesn’t have to be hidden directly), then use.filter(), like this: