Jquery Remove
jQuery - Remove Elements
With jQuery, it is slow to take existing HTML elements.
Remove Elements/Content
To take elements in addition to content, in that place are mainly 2 jQuery methods:- remove() - Removes the selected chemical component division (and its tyke elements)
- empty() - Removes the tyke elements from the selected element
jQuery remove() Method
The jQuery remove() method removes the selected element(s) in addition to its tyke elements.Example
$("#div1").remove();
jQuery empty() Method
The jQuery empty() method removes the tyke elements of the selected element(s).Example
$("#div1").empty();
Filter the Elements to survive Removed
The jQuery remove() method besides accepts 1 parameter, which allows you lot to filter the elements to survive removed.The parameter tin survive whatever of the jQuery selector syntaxes.
The next event removes all <p> elements amongst class="test":
Example
$("p").remove(".test");
Example
$("p").remove(".test, .demo");
Comments
Post a Comment