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");
This event removes all <p> elements amongst class="test" in addition to class="demo":  

Example

$("p").remove(".test, .demo");

     

Comments

Popular posts from this blog

What Are The Main Components of a Computer System

Top Qualities To Look For In An IT Support Team

How To Integrate Google Adwords Api Into Codeigniter?