how to delete a object from dom tree code example
Example: javascript remove dom element
var elem = document.querySelector('#some-element');
elem.parentNode.removeChild(elem);
var elem = document.querySelector('#some-element');
elem.parentNode.removeChild(elem);