Created
March 17, 2010 11:04
-
-
Save fiveminuteargument/335122 to your computer and use it in GitHub Desktop.
Jquery function to remove an element but not its children
This file contains hidden or 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.zap = function () { return this.each(function(){ $(this.childNodes).insertBefore(this); }).remove(); }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment