how to delete a tag in html using js code example Example: delete html with javascript document.querySelector('selector').remove();