aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/jquery/coreTest.js5
-rw-r--r--src/jquery/jquery.js2
2 files changed, 5 insertions, 2 deletions
diff --git a/src/jquery/coreTest.js b/src/jquery/coreTest.js
index dc9c8ed48..a0ae82a49 100644
--- a/src/jquery/coreTest.js
+++ b/src/jquery/coreTest.js
@@ -12,7 +12,7 @@ test("Basic requirements", function() {
});
test("$()", function() {
- expect(3);
+ expect(4);
var main = $("#main");
isSet( $("div p", main).get(), q("sndp", "en", "sap"), "Basic selector with jQuery object as context" );
@@ -32,6 +32,9 @@ test("$()", function() {
pass = false;
}
ok( pass, "$('<tag>') needs optional document parameter to ease cross-frame DOM wrangling, see #968" );
+
+ var form = $("form")[0];
+ equals( 15, $(form.elements).size(), "$(form.elements)" );
});
test("isFunction", function() {
diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js
index 6fb1d5d1d..8ef706204 100644
--- a/src/jquery/jquery.js
+++ b/src/jquery/jquery.js
@@ -176,7 +176,7 @@ jQuery.fn = jQuery.prototype = {
// HANDLE: $(arraylike)
// Watch for when an array-like object is passed as the selector
- (a.jquery || a.length && a != window && !a.nodeType && a[0] != undefined && a[0].nodeType) && jQuery.makeArray( a ) ||
+ (a.jquery || a.length && a != window && (!a.nodeType || (jQuery.browser.msie && a.elements)) && a[0] != undefined && a[0].nodeType) && jQuery.makeArray( a ) ||
// HANDLE: $(*)
[ a ] );