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

后端 未结 9 1634
轮回少年
轮回少年 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:39

    This should work, assuming that you don't have any header elements in tbody.

    $("#<%=tblDetailFourn.ClientID%> tbody tr").remove();
    

提交回复
热议问题