From 728a70c036dfcdc0c45c5c60c08aeade786ce195 Mon Sep 17 00:00:00 2001 From: John Resig Date: Sun, 17 Apr 2011 10:51:24 -0700 Subject: Make sure that forms and selects are added to a jQuery set correctly. Fixes #6912. --- src/traversing.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/traversing.js') diff --git a/src/traversing.js b/src/traversing.js index e0f40151d..8c4b4ef83 100644 --- a/src/traversing.js +++ b/src/traversing.js @@ -160,7 +160,7 @@ jQuery.fn.extend({ add: function( selector, context ) { var set = typeof selector === "string" ? jQuery( selector, context ) : - jQuery.makeArray( selector ), + jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ), all = jQuery.merge( this.get(), set ); return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ? -- cgit v1.2.3