Skip to content

Home

Remove DOM element

Removes an element from the DOM.

const removeElement = el => el.parentNode.removeChild(el);

removeElement(document.querySelector('#my-element'));
// Removes #my-element from the DOM

More like this

Start typing a keyphrase to see matching snippets.