My HTML
<div class="wrapper">
<div class="wrapper2">
<div class="real_content"></div>
</div>
</div>
Question
Is there any way for me to remove the 2 divs around <div class="real_content"></div> so it won't appear on HTML and front end of my website? Thanks.
You could try .replaceWith() (docs):
$('.wrapper').replaceWith( $('.real_content') );
There's also an .unwrap() function (docs), if you'd prefer a more relative way:
$('.real_content').unwrap().unwrap();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With