jquery删除除表头同级所有dom
/** * 清除表格内容(保留表头) */ 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>
相关推荐
EdwardSiCong 2020-11-23
85477104 2020-11-17
hhanbj 2020-11-17
81427005 2020-11-11
seoppt 2020-09-13
honeyth 2020-09-13
WRITEFORSHARE 2020-09-13
84483065 2020-09-11
momode 2020-09-11
85477104 2020-08-15
83510998 2020-08-08
82550495 2020-08-03
tthappyer 2020-08-03
84901334 2020-07-28
tthappyer 2020-07-25
TONIYH 2020-07-22
tztzyzyz 2020-07-20
83510998 2020-07-18
81463166 2020-07-17