I want to check if a table body (tbody
) is empty using jQuery. So far I've tried something like:
$("#searchTable tbody").is(":empty")
But it doesn't work. Any other ideas?
HTML Sample
<table id="searchTable"cellpadding="0" cellspacing="0" width="100%" >
<thead><tr>
<th>No.</th>
<th><a href="#">Status</a></th>
<th><a href="#" class="asc">Category</a></th>
<th><a href="#" class="desc">Title</a></th>
<th><a href="#" class="desc">Last Used</a></th>
<th><a href="#" class="desc">URL</a></th>
<th style="width: 96px;">Actions</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
So i want to check if something was appended in tbody...if not then alert something.