javascript delete element and all child 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 = '';