How to remove child elements js code example
Example 1: delete all childs in node
while (myNode.firstChild) {
myNode.removeChild(myNode.lastChild);
}
Example 2: remove parent element javascript
node.parentNode.parentNode.removeChild(node.parentNode)