javascript how to remove a div code example
Example 1: remove div javascript
var div = document.getElementById('div-01');
div.remove();
Example 2: remove javascript
var elem = document.getElementById("myDiv");
elem.parentNode.removeChild(elem);
var div = document.getElementById('div-01');
div.remove();
var elem = document.getElementById("myDiv");
elem.parentNode.removeChild(elem);