selector = selector || document;\r
\r
// Handle $(DOMElement)\r
- if ( selector.nodeType && !selector.length ) {\r
+ if ( selector.nodeType ) {\r
this[0] = selector;\r
this.length = 1;\r
return this;\r
\r
// HANDLE: $(arraylike)\r
// Watch for when an array-like object, contains DOM nodes, is passed in as the selector\r
- (selector.jquery || selector.length && selector != window && selector[0] != undefined && selector[0].nodeType) && jQuery.makeArray( selector ) ||\r
+ (selector.jquery || selector.length && selector != window && !selector.nodeType && selector[0] != undefined && selector[0].nodeType) && jQuery.makeArray( selector ) ||\r
\r
// HANDLE: $(*)\r
[ selector ] );\r