IE6 will shrink-wrap elements with layout instead of allowing content to flow outside...
[jquery.git] / src / attributes.js
index 1afcf2a..ec4841b 100644 (file)
@@ -164,8 +164,9 @@ jQuery.fn.extend({
                                                var option = options[ i ];
 
                                                // Don't return options that are disabled or in a disabled optgroup
-                                               if ( option.selected && option.getAttribute("disabled") === null && 
+                                               if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) && 
                                                                (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
+
                                                        // Get the specific value for the option
                                                        value = jQuery(option).val();
 
@@ -294,7 +295,14 @@ jQuery.extend({
                                                jQuery.error( "type property can't be changed" );
                                        }
 
-                                       elem[ name ] = value;
+                                       if ( value === null ) {
+                                               if ( elem.nodeType === 1 ) {
+                                                       elem.removeAttribute( name );
+                                               }
+
+                                       } else {
+                                               elem[ name ] = value;
+                                       }
                                }
 
                                // browsers index elements by id/name on forms, give priority to attributes.