Skip to main content Accessibility Feedback

DOM Injection

Element.remove()

Remove an element from the DOM. Call the remove() method on the element you want to remove.

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

Requires a polyfill for IE.