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

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

    Have you tried this?:

    $("#<%=tblDetailFourn.ClientID%> tbody").html('')
    
    0 讨论(0)
  • 2020-12-28 17:58
    $('#tblDetailFourn tbody').empty();
    
    0 讨论(0)
  • 2020-12-28 17:59

    Based on the html you provided the solution is following

    $("#tblDetailFourn tbody").empty();
    

    This will work perfectly.

    Thanks

    0 讨论(0)
提交回复
热议问题