Adding in .unwrap() support, thanks to Ben Alman! Fixes #5191.
[jquery.git] / src / manipulation.js
index 547acc1..ef4eb3e 100644 (file)
@@ -90,6 +90,14 @@ jQuery.fn.extend({
                });
        },
 
+       unwrap: function() {
+               return this.parent().each(function(){
+                       if ( !jQuery.nodeName( this, "body" ) ) {
+                               jQuery( this ).replaceWith( this.childNodes );
+                       }
+               }).end();
+       },
+       
        append: function() {
                return this.domManip(arguments, true, function(elem){
                        if ( this.nodeType === 1 ) {