MENU
Deletion
.detach([String selector])<br>Remove the matched elements from the DOM and returns the jQuery object associated with the removed elements.<br>.empty()<br>Remove all child nodes of the matched elements from the DOM. The matched elements themselves are not removed.<br>.remove([String selector])<br>Remove the matched elements from the DOM.<br><br>.replaceAll(String/Element/Array/jQuery selector)<br>Replace each target element with the set of matched elements..replaceWith(String/Element/Array/jQuery newCont)<br>.replaceWith(function f)<br>Replace each matched element with the provided new content and return the set of elements that were removed.<br>.unwrap()<br>Remove the parent of each matched element from the DOM.
RESETRUNFULL
RESETRUNFULL
Consider the following example:
<p>A</p>
<p>B</p>
<p>C</p>
var p = $('p:first').detach();$('p').after(p);GIVES
<p>B</p><p>A</p>
<p>C</p><p>A</p>
$('p').empty();GIVES
<p></p>
<p></p>
<p></p>
$('p:first').remove();GIVES
<p>B</p>
<p>C</p>
$('p:first').replaceAll('p');GIVES
<p>A</p>
<p>A</p>
<p>A</p>
$('p:first').replaceWith('p');GIVES
p
<p>B</p>
<p>C</p>
$('p').contents().unwrap();GIVES
A
B
C