Answers for "javascript how to remove element from document"

15

javascript remove element by id

//removing element by ID
var element = document.getElementById("myElementID");
    element.parentNode.removeChild(element);
Posted by: Guest on July-24-2019
0

delete element html javascript

function removeElement(elementId) {
// Removes an element from the document.
var element = document. getElementById(elementId);
element. parentNode. removeChild(element);
}
Posted by: Guest on December-27-2020

Code answers related to "javascript how to remove element from document"

Code answers related to "Javascript"

Browse Popular Code Answers by Language