document.getElementById("myBtn").disabled=true 哪里出错IE 火狐 谷歌都不行
<!DOCTYPEhtml><html><head><title>按钮在单击以后就失效</title><metahttp-equiv="Content-Type"cont...
<!DOCTYPE html>
<html>
<head>
<title>按钮在单击以后就失效</title>
<meta http-equiv="Content-Type" content="text/heml;charset=UTF-8"/ >
<script type="text/javascript">
function submitForm(){
document.getElementById("myBtn").disabled=true;
document.forms[0].submit();
}
</script>
</head>
<body style="text-align:center;" >
<form action="" method="post" style="display:block;width:250px;height:100px;border:1px solid black;">
<br/>
用户名: <input type="text" name="username"/><br/>
密码:<input type="password" name="password" />
<input type="button" value="提交" onclick="submitForm();" id="myBtn"/>
</form>
</body>
</html> 展开
<html>
<head>
<title>按钮在单击以后就失效</title>
<meta http-equiv="Content-Type" content="text/heml;charset=UTF-8"/ >
<script type="text/javascript">
function submitForm(){
document.getElementById("myBtn").disabled=true;
document.forms[0].submit();
}
</script>
</head>
<body style="text-align:center;" >
<form action="" method="post" style="display:block;width:250px;height:100px;border:1px solid black;">
<br/>
用户名: <input type="text" name="username"/><br/>
密码:<input type="password" name="password" />
<input type="button" value="提交" onclick="submitForm();" id="myBtn"/>
</form>
</body>
</html> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询