remove children of element javascript 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)