我有一个表单页面,可以从弹出窗口向数据库提交数据。我为提交数据添加了一个禁用的js按钮。在ie11中无法工作,但对其他浏览器完美适用。
<script language="javascript" type="text/javascript">
// disables the button specified and sets its style to a disabled "look".
function disableButtonOnClick(oButton, sButtonText, sCssClass)
{
// set button to disabled so you can't click on it.
oButton.disabled = true;
// change the text of the button.
oButton.value = sButtonText;
// IE uses className for the css property.
oButton.setAttribute('className', sCssClass);
// Firefox, Safari use class for the css property.
oButton.setAttribute('class', sCssClass);
}
</script>
setAttribute
而不是直接设置属性呢? - Jeremy J Starcher