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"
}
本文转自豪情博客园博客,原文链接:http://www.cnblogs.com/jikey/archive/2009/12/06/1618156.html,如需转载请自行联系原作者