js document remove code example
Example 1: remove div javascript
var div = document.getElementById('div-01');
div.remove();
Example 2: delete element html javascript
function removeElement(elementId) {
// Removes an element from the document.
var element = document. getElementById(elementId);
element. parentNode. removeChild(element);
}