How can I delete all rows of an HTML table except the
Assign an id or a class for your tbody. You can name your id or class how you want, not necessarily \'s using Javascript, and without looping through all the rows in the table? I have a very huge
document.querySelector("#tbodyId").remove();
document.querySelectorAll(".tbodyClass").remove();
#tbodyId or .tbodyClass.