The unwrap() method remove the parents of the selected elements from the DOM and leave the matched elements in their place.
.unwrap() method does not accept any arguments.
You have the following HTML:
<div class="main"> <div class="wrap"><div class="sub">John Doe</div></div> <div class="wrap"><div class="sub">Jane Doe</div></div> </div>
Using .unwrap() method you can remove wrapping div with class “sub”.
$(".sub").unwrap();
Result will be:
<div class="main"> <div class="sub">John Doe</div> <div class="sub">Jane Doe</div> </div>
Based on United States, Jacob Frazier is a skilled JavaScript developer with over 8 years of experience. He is passionate about change and trying new things, both professionally and personally. He loves startups and is extremely proactive.
Small businesses are the backbone of the economy. Still, they often face daunting hurdles when…
Introduction: As the chill of winter settles in or a bout of cold weather strikes,…
Nestled along the glittering waterfront of the City of Gold, Dubai Marina beckons to discerning…
If you want to open a match-making dating app in the wide digital market and…
When was the last time you heard that a clone app like Gojek could efficiently…
The e-commerce market is growing and evolving at a rapid pace. More and more people…