JavaScript中删除子节点的方法有以下几种:
var parent = document.getElementById("parent");
var child = document.getElementById("child");
parent.removeChild(child);
var child = document.getElementById("child");
child.remove();
var parent = document.getElementById("parent");
parent.innerHTML = "";
var parent = document.getElementById("parent");
while (parent.firstChild) {
parent.removeChild(parent.firstChild);
}