Skip to content

Instantly share code, notes, and snippets.

@fiveminuteargument
Created March 17, 2010 11:04
Show Gist options
  • Save fiveminuteargument/335122 to your computer and use it in GitHub Desktop.
Save fiveminuteargument/335122 to your computer and use it in GitHub Desktop.
Jquery function to remove an element but not its children
$.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