📌  相关文章
📜  删除列表的所有子节点:- Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:51.731000             🧑  作者: Mango

代码示例1
// Get the 
    element with id="myList" let list = document.getElementById("myList"); // As long as
      has a child node, remove it while (list.hasChildNodes()) { list.removeChild(list.firstChild); }