jquery删除除表头同级所有dom

5 篇文章 0 订阅
1 篇文章 0 订阅

/**
* 清除表格内容(保留表头)
*/
function clearTr(){
//清除表格节点内容(不包含表头)
$("#roleInfo .c666").nextAll().each(function(i){
$(this).remove();
});
}



<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" style="margin: auto;">
<tr>
<td height="35" align="left" bgcolor="#EAF4EA" style="padding-left:10px; /*display: none;*/ ">
<input id="role_seach_txt" type="text" style="width:150px; height:19px;" />
<input id="role_seach_btn" type="button" value="搜索" style="background:url(../img/btn_search.gif); width:57px; height:25px; border:0;" />
</td>
<td width="35%" height="35" align="left" bgcolor="#EAF4EA" style="padding-left:10px;">
<input id='toolbar_btn_add' name="toolbar_btn_add" type="button" value ="添加" class="btn_666"/>
<input id='toolbar_btn_mod' name="toolbar_btn_mod" type="reset" value="修改" class="btn_666"/>
<input id='toolbar_btn_del' name="toolbar_btn_del" type="button" value="删除" class="btn_666"/>
</td>
</tr>
</table>
<br>
<table id="roleInfo" width="95%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#D7E6CC" style="margin: auto; font-size: 12px;">
<tr class="c666">
<th height="20" width="2%" align="left" bgcolor="#F2F9F2">序号</th>
<th width="10%" bgcolor="#F2F9F2">角色编号</th>
<th width="10%" bgcolor="#F2F9F2">角色名称</th>
</tr> </table>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值