当前位置:网站首页>How to dynamically delete data rows in a table through JS (keep the head)

How to dynamically delete data rows in a table through JS (keep the head)

2022-06-13 08:06:00 ReuterK

How to use JS Delete dynamically table Data rows in ( Retain head)

    var Oldtab = document.getElementById(tableID);
    var rowNum = Oldtab.rows.length-1;
    for(var i=0; i<rowNum; i++)
    {
    
      Oldtab.deleteRow(Oldtab.rows.length-1);	//Delete the last row
    }
原网站

版权声明
本文为[ReuterK]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/164/202206130801331892.html