Skip to content
Permalink
Browse files

Added a fix for setting the style property in IE: .attr("style", "...…

…") (bug #1170).
  • Loading branch information
jeresig committed Jul 21, 2007
1 parent 97a6bdb commit 37407164803df62c4efb1332e7f94b56e693a108
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/jquery/jquery.js
@@ -1567,13 +1567,14 @@ jQuery.extend({
if ( fix[name] ) {
if ( value != undefined ) elem[fix[name]] = value;
return elem[fix[name]];
} else if ( jQuery.browser.msie && name == "style" )
return jQuery.attr( elem.style, "cssText", value );

} else if ( value == undefined && jQuery.browser.msie && jQuery.nodeName(elem, "form") && (name == "action" || name == "method") )
else if ( value == undefined && jQuery.browser.msie && jQuery.nodeName(elem, "form") && (name == "action" || name == "method") )
return elem.getAttributeNode(name).nodeValue;

// IE elem.getAttribute passes even for style
else if ( elem.tagName ) {


if ( value != undefined ) elem.setAttribute( name, value );
if ( jQuery.browser.msie && /href|src/.test(name) && !jQuery.isXMLDoc(elem) )
@@ -1850,6 +1851,7 @@ new function() {
selected: "selected",
maxlength: "maxLength"
};

};

/**

0 comments on commit 3740716

Please sign in to comment.
You can’t perform that action at this time.