mirror of
https://github.com/jquery/jquery.git
synced 2026-02-02 07:34:56 -05:00
Wrap: Support .unwrap( selector) for selective unwrapping
Fixes gh-1744
Closes gh-2003
(cherry picked from commit 7b09235cee)
This commit is contained in:
11
src/wrap.js
11
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;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user