adsense

Wednesday, October 28, 2020

Remove all table rows except first

You can use jQery to easily remove rows from a given table.

//using jQuery find

$(function() {
   $("#tableId").find("tr:gt(0)").remove();
});
//using empty
$(function() {
  $("#tableId > tbody").empty();
});
The second method is more efficient than the first approach.
Regards,
Samitha

No comments:

Post a Comment