Reputation: 2915
I want to delete only the parent div and keep their children as it is :
<div id="main">
<div id="1"></div>
<div id="2"></div>
</div>
How we can delete only the #main div
without deleting its children div #1 & #2
?. I tried detach()
but it didn't work.
Upvotes: 0
Views: 63
Reputation: 114347
Replace the element with its contents.
$('#main').replaceWith($(this).html())
Upvotes: 1