Skip to main content Accessibility Feedback

DOM Injection

Element.removeChild()

Remove an element from the DOM. This method is called against the target element’s parent, which you can get with parentNode.

var elem = document.querySelector('#some-element');
elem.parentNode.removeChild(elem);

Works back to at least IE6.