Created
April 15, 2009 21:07
-
-
Save furf/96020 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* $.fn.unwrap | |
* Unwraps an element (replaces an elements parent with the element) | |
* | |
* NO LONGER NECESSARY AS OF jQuery 1.4 | |
* | |
* Example: | |
* $('#foo').unwrap(); | |
* Will replace: | |
* <div><span id="foo">bar</span></div> | |
* with: | |
* <span id="foo">bar</span> | |
*/ | |
$.fn.unwrap = function() { | |
return this.replaceWith(this.html()); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment