aboutsummaryrefslogtreecommitdiffstats
path: root/src/manipulation.js
diff options
context:
space:
mode:
authorRick Waldron <waldron.rick@gmail.com>2013-04-16 22:16:12 -0400
committerRick Waldron <waldron.rick@gmail.com>2013-04-16 22:18:44 -0400
commit77d7f264524677104cd7f37ecdb631d5824eacd4 (patch)
treea391a15673534ee7f60328793e47fc289becde7f /src/manipulation.js
parentdb0326b1fdd22b97e24af34245e38914c04a70ba (diff)
downloadjquery-77d7f264524677104cd7f37ecdb631d5824eacd4.tar.gz
jquery-77d7f264524677104cd7f37ecdb631d5824eacd4.zip
Fixes #13779. Remove nodes in document order (uses for loop matching empty()).
Diffstat (limited to 'src/manipulation.js')
-rw-r--r--src/manipulation.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/manipulation.js b/src/manipulation.js
index 3747e0924..ac1bf2bbf 100644
--- a/src/manipulation.js
+++ b/src/manipulation.js
@@ -75,9 +75,10 @@ jQuery.fn.extend({
remove: function( selector, keepData ) {
var elem,
elems = selector ? jQuery.filter( selector, this ) : this,
- i = elems.length;
+ i = 0,
+ l = elems.length;
- while ( i-- ) {
+ for ( ; i < l; i++ ) {
elem = elems[ i ];
if ( !keepData && elem.nodeType === 1 ) {