Remove element from DOM

less than 1 minute read

Remove element from DOM

var element = document.getElementById("veryCoolID");
if (element != null) {
    element.parentNode.removeChild(element);
}

Leave a comment