Used the patch from Alexander as the basis for a rewrite of the IE change event logic...
[jquery.git] / src / attributes.js
index 0509781..e7e5d37 100644 (file)
@@ -232,13 +232,13 @@ jQuery.extend({
                offset: true
        },
                
-       attr: function( elem, name, value ) {
+       attr: function( elem, name, value, pass ) {
                // don't set attributes on text and comment nodes
                if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
                        return undefined;
                }
 
-               if ( name in jQuery.attrFn && value !== undefined ) {
+               if ( pass && name in jQuery.attrFn ) {
                        return jQuery(elem)[name](value);
                }
 
@@ -268,14 +268,7 @@ jQuery.extend({
                                                throw "type property can't be changed";
                                        }
 
-                                       // browsers index elements by id/name on forms, give priority to attributes.
-                                       if( jQuery.nodeName( elem, "form" ) ) {
-                                               // convert the value to a string (all browsers do this but IE) see #1070
-                                               elem.setAttribute( name, "" + value );
-
-                                       } else {
-                                               elem[ name ] = value;
-                                       }
+                                       elem[ name ] = value;
                                }
 
                                // browsers index elements by id/name on forms, give priority to attributes.