javascript remove dom element
snippet in javascript

javascript remove element by id

user1512

//removing element by ID
var element = document.getElementById("myElementID");
    element.parentNode.removeChild(element);

javascript remove dom element

user1445

var elem = document.querySelector('#some-element');
elem.parentNode.removeChild(elem);

javascript remove element

user5638

//remove a dom element
var element = document.getElementById("someId");
	element.parentNode.removeChild(element);

//remove element from array
var colors=["red","green","blue","yellow"];
var blue=colors.splice(2, 1);//first arg is array index to remove
//colors is now ["red","green","yellow"]

javascript remove element from the dom

user3433

node.remove();