js dom remove all elements code example
Example 1: delete all childs in node
while (myNode.firstChild) {
myNode.removeChild(myNode.lastChild);
}
Example 2: js remove all child elements from html
document.getElementById("myId").innerHTML = '';
while (myNode.firstChild) {
myNode.removeChild(myNode.lastChild);
}
document.getElementById("myId").innerHTML = '';