Commit 899ee03d authored by John Resig's avatar John Resig

Fixed a bug in .dir() where it would return non-element nodes.

parent f38251b2
...@@ -404,7 +404,8 @@ jQuery.extend({ ...@@ -404,7 +404,8 @@ jQuery.extend({
var matched = []; var matched = [];
var cur = elem[dir]; var cur = elem[dir];
while ( cur && cur != document ) { while ( cur && cur != document ) {
matched.push( cur ); if ( cur.nodeType == 1 )
matched.push( cur );
cur = cur[dir]; cur = cur[dir];
} }
return matched; return matched;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment