how to delete a div element in javascript code example
Example 1: javascript remove element by id
var element = document.getElementById("myElementID");
element.parentNode.removeChild(element);
Example 2: remove div javascript
var div = document.getElementById('div-01');
div.remove();
Example 3: js delete element
var elem = document.querySelector('#some-element');
elem.parentNode.removeChild(elem);
var elem = document.querySelector('#some-element');
elem.style.display = 'none';
Example 4: remove in javascript
function arrayRemove(arr, value)
{
return arr.filter(function(ele){
return ele != value;
});
}