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 =)

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s