Let's say I have:
<a href=''>
<div>hello</div>
</a>
I want to remove the A element so to obtain:
<div>hello</div>
Can this be done in jQuery?
Let's say I have:
<a href=''>
<div>hello</div>
</a>
I want to remove the A element so to obtain:
<div>hello</div>
Can this be done in jQuery?
use the unwrap() of jquery http://api.jquery.com/unwrap/
$('div').unwrap();
The .unwrap()
method removes the element's parent.
$('div').unwrap();