mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Simplify jQuery#wrap
This commit is contained in:
parent
2378438a97
commit
8c4b9f082b
@ -156,15 +156,14 @@ jQuery.fn.extend({
|
||||
var elem,
|
||||
i = 0;
|
||||
|
||||
for ( ; (elem = this[i]) != null; i++ ) {
|
||||
// Remove element nodes and prevent memory leaks
|
||||
for ( ; ( elem = this[ i ] ) != null; i++ ) {
|
||||
if ( elem.nodeType === 1 ) {
|
||||
|
||||
// Remove element nodes and prevent memory leaks
|
||||
jQuery.cleanData( getAll( elem, false ) );
|
||||
}
|
||||
|
||||
// Remove any remaining nodes
|
||||
while ( elem.firstChild ) {
|
||||
elem.removeChild( elem.firstChild );
|
||||
elem.textContent = "";
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user