jQuery – unwrap

As of jQuery 1.4, you can unwrap an element with the unwrap() function. Prior to jQuery 1.4, you can unwrap a specific element by

$(this).parent().replaceWith(this);

 

For more details, you can take a look on the blog post by Ben AlmanjQuery unwrap: The opposite of .wrap, pretty much

Done =)

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.