how to delete html code from javascript code example Example: delete html with javascript document.querySelector('selector').remove();