document.getElementById('the_element_id').outerHTML = '';
This is arguable the simplest and most cross-browser friendly way to remove an element from the DOM. Essentially, we're just setting the elements outer HTML to an empty string, which removes the element.
Snippet Viewed 792 times.
- Get some recognition & link back to your site.