delete a row in table with javascript code example
Example 1: javascript remove row from table
document.getElementById("myTable").deleteRow(0); // First row
document.getElementById("myTable").deleteRow(-1); // Last row
function deleteRow(r) {
var i = r.parentNode.parentNode.rowIndex;
document.getElementById("myTable").deleteRow(i);
}
Example 2: delete all the rows of table javascript
$("#table_of_items tr").remove();