removeChild CODE
To remove an HTML element, we can select the parent of the element and use the
removeChild
(node) method JS
window.onload = function() {
    var parent = document.getElementById("demo");
    parent.removeChild(document.getElementById("p1"));
};
HTML
<div id="demo">
    <p id="p1">This is a paragraph.</p>
    <p id="p2">This is another paragraph.</p>
</div>
by Valeri Tandilashvili
4 years ago
JavaScript
DOM
3
Pro tip: use ```triple backticks around text``` to write in code fences