Removing Element in JavaScript
Removing Element
To remove an HTML element, you must select the parent of the element and use the removeChild(node) method. The other way is to select the parentNode and then remove a child node from it.
Syntax:-
var parent_element = document.getElementById("parent_element ");
var child_element = document.querySelector("#child_element ");
parent_element .removeChild(child_element );