Using remove() to delete DOM elements
The remove() method allows you to delete elements from the DOM. This is useful for creating dynamic, interactive pages!
// Get the element you want to remove
let element = document.getElementById("myElement");
// Remove it from the DOM
element.remove();
// The element is now gone from the page!