📜  javascript 清除子元素 - Javascript 代码示例

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

代码示例3
parent.querySelectorAll("*").forEach(child -> child.remove());

//Change the value of * if there is a specific class you want to remove 
//otherwise leave the * for removing all child elements.