From 899ee03d37b6cbe6d0e8abc497026d611325cfba Mon Sep 17 00:00:00 2001 From: John Resig Date: Mon, 10 Sep 2007 00:00:30 +0000 Subject: [PATCH] Fixed a bug in .dir() where it would return non-element nodes. --- src/selector.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/selector.js b/src/selector.js index 1fbbe9b..f746fe1 100644 --- a/src/selector.js +++ b/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; -- 1.7.10.4