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

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

    Try http://api.jquery.com/child-selector/

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

    What you have should work though.

提交回复
热议问题