jQuery를 사용하여 테이블 본문 (tbody
)이 비어 있는지 확인하고 싶습니다. 지금까지 나는 다음과 같은 것을 시도했다 :.append를 사용한 후 요소가 비어 있는지 확인하십시오.
$("#searchTable tbody").is(":empty")
그러나 작동하지 않는다. 다른 아이디어?
HTML 샘플
<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>
그래서 뭔가 TBODY에 추가되었는지 확인하려면; 그렇지 않다면 경고하십시오.
어떤 방식으로 작동하지 않습니까? HTML 샘플을 볼 수 있을까요? – Matchu