There are mainly two jQuery methods:
remove() - Removes the selected element (and its child elements) Also can be delete
empty() - Removes the child elements from the element, Which are selected
What is remove() Method
The jQuery remove() method removes the selected element(s) and also its child elements.
Example
What is empty() Method
The jQuery empty() method removes the child elements of the selected element(s).
Example
Filter the Elements to be Removed
The remove() method also accepts one parameter, which allows you to filter the elements to be removed.
The parameter can be any of the selector syntaxes.
Following example removes all <p> elements with class="test":
Example
This example removes all <p> elements with class="test" or class="test2":
Example
Required fields are marked *
Get all latest content delivered to your email free.