Skip to content
Browse files

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

  • Loading branch information...
1 parent f38251b commit 899ee03d37b6cbe6d0e8abc497026d611325cfba @jeresig jeresig committed
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/selector.js
View
3 src/selector.js
@@ -404,7 +404,8 @@ jQuery.extend({
var matched = [];
var cur = elem[dir];
while ( cur && cur != document ) {
- matched.push( cur );
+ if ( cur.nodeType == 1 )
+ matched.push( cur );
cur = cur[dir];
}
return matched;

0 comments on commit 899ee03

Please sign in to comment.
Something went wrong with that request. Please try again.