我有一个表结构,如下所示。
<table>
<thead>
<tr></tr>
<tr></tr>
</thead>
<tfoot>
<tr></tr>
<tr></tr>
</tfoot>
<tbody>
<tr></tr>
<tr></tr>
</tbody>
</table>我想在点击标题的第一行时切换显示/隐藏tbody和tfoot。我尝试了很多东西,但失败了,因为可能有多个这样的表。我正在使用jquery。提前谢谢。
发布于 2013-06-27 15:27:54
$('thead tr:first-child').on('click',function(){
$(this).closest('table').find('tbody, tfoot').toggle();
});https://stackoverflow.com/questions/17336564
复制相似问题