➥ jQuery Tutorial
➥ jQuery Effects
- jQuery Effects
- jQuery Effects - Fading
- jQuery Effects - Sliding
- jQuery Effects - Animation
- jQuery Stop Animations
- jQuery Callback Functions
- jQuery - Chaining
➥ jQuery HTML
- jQuery - Get
- jQuery - Set
- jQuery - Add Elements
- jQuery - Remove Elements
- jQuery - CSS Classes
- jQuery - css() Method
- jQuery - Dimensions
➥ jQuery Traversing
- jQuery Traversing - Ancestors
- jQuery Traversing - Descendants
- jQuery Traversing - Siblings
- jQuery Traversing - Filtering
➥ jQuery AJAX
➥ jQuery Misc
Tutorial
jQuery - Element Removal
It is simple to eliminate HTML elements with jQuery.
Element/Content Removal
There are 2 major jQuery processes for removing elements and subject matter:
remove() - Removes the quick access element (and its child elements)
empty() - Eliminates this same selected element's child elements.
remove() method in jQuery
The jQuery eliminate() method deletes the chosen element(s) and all of its children.
Illustration:
EXAMPLE ❯
Method empty() of jQuery
The empty() method of the jQuery library eliminates the chosen element's child components (s).
Illustration:
EXAMPLE ❯
Eliminate the Elements by Sorting
The remove() method in jQuery also takes each variable, that also makes it possible users to sort the elements which will be eliminated.
Any of jQuery selector syntaxes could be used as the parameter.
This same illustration below eliminates most p> elements with class="test":
Illustration:
EXAMPLE ❯
All p> elements with the classes="test" and "demo" are eliminated in this illustration:
Illustration: