how to remove an html element on click javascript code example Example: delete html with javascript document.querySelector('selector').remove();