/**\r
* Set a single property to a value, on all matched elements.\r
*\r
+ * Note that you can't set the name property of input elements in IE.\r
+ * Use $(html) or $().append(html) or $().html(html) to create elements\r
+ * on the fly including the name property.\r
+ *\r
* @example $("img").attr("src","test.jpg");\r
* @before <img/>\r
* @result <img src="test.jpg"/>\r
\r
ret = elem.style[prop];\r
\r
- } else if (elem.currentStyle) {\r
-\r
- var newProp = prop.replace(/\-(\w)/g,function(m,c){return c.toUpperCase();});\r
- ret = elem.currentStyle[prop] || elem.currentStyle[newProp];\r
-\r
} else if (document.defaultView && document.defaultView.getComputedStyle) {\r
\r
if (prop == "cssFloat" || prop == "styleFloat")\r
ret = 'none';\r
else\r
jQuery.swap(elem, { display: 'block' }, function() {\r
- ret = document.defaultView.getComputedStyle(this,null).getPropertyValue(prop);\r
+ var c = document.defaultView.getComputedStyle(this, '');\r
+ ret = c && c.getPropertyValue(prop) || '';\r
});\r
\r
+ } else if (elem.currentStyle) {\r
+\r
+ var newProp = prop.replace(/\-(\w)/g,function(m,c){return c.toUpperCase();});\r
+ ret = elem.currentStyle[prop] || elem.currentStyle[newProp];\r
+ \r
}\r
\r
return ret;\r