]> source.dussan.org Git - jquery.git/commitdiff
Retrieve the class attribute on a form in IE6/7. Fixes 9286.
authortimmywil <tim.willison@thisismedium.com>
Sat, 14 May 2011 16:07:40 +0000 (12:07 -0400)
committertimmywil <tim.willison@thisismedium.com>
Sat, 14 May 2011 16:07:40 +0000 (12:07 -0400)
src/attributes.js
test/unit/attributes.js

index af1660fa68299a8f501c3c9d11914388d230e0b7..0eac08a6f069f29b1bc826373350cebefcf21e73 100644 (file)
@@ -322,7 +322,9 @@ jQuery.extend({
                                hooks = boolHook;
 
                        // Use formHook for forms and if the name contains certain characters
-                       } else if ( formHook && (jQuery.nodeName( elem, "form" ) || rinvalidChar.test( name )) ) {
+                       } else if ( formHook && name !== "className" &&
+                               (jQuery.nodeName( elem, "form" ) || rinvalidChar.test( name )) ) {
+
                                hooks = formHook;
                        }
                }
index 79730026a4a82729bfaf8be624c817b6c06e8926..8f2eb723703427abd7074e72cf0717ce94f347c5 100644 (file)
@@ -40,7 +40,7 @@ test("jQuery.attrFix/jQuery.propFix integrity test", function() {
 });
 
 test("attr(String)", function() {
-       expect(38);
+       expect(39);
 
        equals( jQuery("#text1").attr("type"), "text", "Check for type attribute" );
        equals( jQuery("#radio1").attr("type"), "radio", "Check for type attribute" );
@@ -117,6 +117,9 @@ test("attr(String)", function() {
 
        ok( jQuery("<div/>").attr("doesntexist") === undefined, "Make sure undefined is returned when no attribute is found." );
        ok( jQuery().attr("doesntexist") === undefined, "Make sure undefined is returned when no element is there." );
+
+       var $form = jQuery("<form class='something'></form>").appendTo("#qunit-fixture");
+       equal( $form.attr("class"), "something", "Retrieve the class attribute on a form" );
 });
 
 if ( !isLocal ) {