為什么if里面設(shè)置disabled=""能實(shí)現(xiàn),而設(shè)置disabled="false",反而實(shí)現(xiàn)不了????
<!doctype html>
<html>
<head>
? ? <meta charset="UTF-8">
<title>Document</title>
<script type="text/javascript">
window.onload=function(){
? ?var send=document.getElementById('send'),
? ? ? ?times=60,
? ? ? ?timer=null;
? ?send.onclick=function(){
? ? ?// 計(jì)時(shí)開始?
? ? ? ? ? ? ?timer=setInterval(function(){
? ? ? ? ? ? ? ? times--;
? ? ? ? ? ? ? ? if(times<=0){
? ? ? ? ? ? ? ? ? ? clearInterval(timer);
? ? ? ? ? ? ? ? ? ? send.value="發(fā)送驗(yàn)證碼";
? ? ?send.disabled="";
times=60;
? ? ? ? ? ? ? ? }else{
send.value=times+"秒后重試";
send.disabled="true";
? ? ? ? ? ? ? ? }
? ? ? ? ? ? },1000);
? ?}?
}
</script>
</head>
<body>
<input type="button" id="send" value="發(fā)送驗(yàn)證碼">
</body>
</html>
2017-01-10
disabled:禁用的意思;true就是禁用的意思,F(xiàn)ALSE就是開啟的意思,相當(dāng)于 負(fù)負(fù)得正 的那個(gè)意思
2016-12-24
把false的引號(hào)去掉就可以用