May 07, 2021 jQuery
jQuery makes it easy to remove existing HTML elements.
To remove elements and content, there are two jQuery methods that you can typically use:
The jQuery remove() method removes the selected element and its children.
Tip: In the jQuery programming battle section of this site, you can practice how to use jQuery to remove an HTML element!
The jQuery empty() method removes the child elements of the selected element.
The jQuery remove() method also accepts a parameter that allows you to filter deleted elements.
This parameter can be the syntax of any jQuery selector.
The following example removes all of the elements of class-"italic":