An element can be removed by calling remove() on it. Alternatively, one can call removeChild() on its parent. removeChild() has better browser support than remove().
element.remove();
element, and all its childnodes, are removed from the DOM.
parentElement.removeChild(element);
element...