<table>
<tbody>
<tr class="row-1 row-first">
<td><div class="inside">Text</div></td>
<td><div class="inside">Text</div></td>
<td><div class="inside">Text</div></td>
</tr>
<tr class="row-2">
<td><div class="inside"></div></td>
<td><div class="inside">Text</div></td>
<td><div class="inside">Text</div></td>
</tr>
<tr class="row-3 row-last">
<td><div class="inside"></div></td>
<td><div class="inside">Text</div></td>
<td><div class="inside">Text</div></td>
</tr>
</tbody>
</table>
That is my HTML.. I want to know the count of td's which does not have an empty div (with class="inside") in jQuery? How do I go about it?
Something like this, with the has
, not
, and empty
selectors:
$('td:not(:has(div.inside:empty))').length;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With