diff options
author | Oleg <markelog@gmail.com> | 2012-12-19 22:42:07 +0400 |
---|---|---|
committer | Oleg <markelog@gmail.com> | 2012-12-24 03:03:28 +0400 |
commit | 8c4b9f082bee05218f7e218b5a0db12e5e333ef4 (patch) | |
tree | 530b62ac3b48aea65816cf489b95dfd0d10e2a76 | |
parent | 2378438a9773254a49ffe4d42cc195f7b35b1a29 (diff) | |
download | jquery-8c4b9f082bee05218f7e218b5a0db12e5e333ef4.tar.gz jquery-8c4b9f082bee05218f7e218b5a0db12e5e333ef4.zip |
Simplify jQuery#wrap
-rw-r--r-- | src/manipulation.js | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/manipulation.js b/src/manipulation.js index 9a60d1089..e0edab197 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -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 ); + // Remove any remaining nodes + elem.textContent = ""; } } |