diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/wrap.js | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/wrap.js b/src/wrap.js index ee02aca75..0d9bf0f2e 100644 --- a/src/wrap.js +++ b/src/wrap.js @@ -63,12 +63,11 @@ jQuery.fn.extend({ }); }, - unwrap: function() { - return this.parent().each(function() { - if ( !jQuery.nodeName( this, "body" ) ) { - jQuery( this ).replaceWith( this.childNodes ); - } - }).end(); + unwrap: function( selector ) { + this.parent( selector ).not( "body" ).each(function() { + jQuery( this ).replaceWith( this.childNodes ); + }); + return this; } }); |