Reputation: 23593
Im using jQuery's unwrap function however I want it to only unwrap if the parent div (the one to be deleted) has a certain class.
I was using this:
$('.children').unwrap();
I tried changing it to this, so the parent would only be removed if it has a class of 'parent', but the code behaves the same as above. Thanks
$('.children').unwrap('.parent');
Upvotes: 2
Views: 3750