Hey, I'm not sure if this is possible but anyway. Say for example:
<div id="foo">
<a href="#" id="bar">Remove Parent</a>
</div>
$(function() {
$('#bar').click(function() {
$(this).parent().remove();
});
});
Is it possible that you can remove the parent container, in this example #foo
but keep the child anchor tag #bar
?
In this situation you'd be looking for .unwrap()
example...
$(function() {
$('#bar').click(function() {
$(this).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