How to remove all rows of the table but keep the header

后端 未结 9 1639
轮回少年
轮回少年 2020-12-28 17:23

I want to remove all rows of my table except the header.

This is what I\'ve tried but it always deletes all rows and header:

$(\"#<%=tblDetailFour         


        
9条回答
  •  庸人自扰
    2020-12-28 17:36

    Try using this:

    $('#<%=tblDetailFourn.ClientID%> tr').not(function(){ return !!$(this).has('th').length; }).remove();
    

提交回复
热议问题