jQuery .unwrap()

jQuery .unwrap() removes the parents of the set of matched elements from the DOM, leaving the matched elements in their place.

js:


$('.target').unwrap();

html:


Before script:

<div class="wrapper"><div class="target">.target</div></div>



After script:

<div class="target">.target</div>

Leave a Comment