setAttribute在设置属性 ieBug

转自:http://www.cnblogs.com/rubylouvre/archive/2009/12/01/1614251.html 

setAttribute在设置属性时,有许多属性在IE下与标准浏览器的命名是不一样的,看一下jQuery,发现它也是不全的。许多地雷埋在这里,总有一个你迟早会中的。下面是一个详尽的参照表:左边为标准游览器的,右边是IE的。

var IEfix = {
acceptcharset: "acceptCharset",
accesskey: "accessKey",
allowtransparency: "allowTransparency",
bgcolor: "bgColor",
cellpadding: "cellPadding",
cellspacing: "cellSpacing",
"class":  "className",
colspan:  "colSpan",
checked: "defaultChecked",
selected: "defaultSelected",
"for":  "htmlFor" ,
frameborder:  "frameBorder",
hspace:  "hSpace",
longdesc:  "longDesc",
maxlength:  "maxLength",
marginwidth:  "marginWidth",
marginheight:  "marginHeight",
noresize:  "noResize",
noshade:  "noShade",
readonly: "readOnly",
rowspan:  "rowSpan",
tabindex:  "tabIndex",
valign:  "vAlign",
vspace:  "vSpace"

} 

你可能感兴趣的:(attribute)