📅  最后修改于: 2022-03-11 15:01:51.731000             🧑  作者: Mango
// 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);
}