亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

倒計時到2秒 就沒了,求解

<!DOCTYPE?html>
<html>
<head>
	<meta?charset="UTF-8">
	<title></title>
	<script?type="text/javascript">
		window.onload?=?function(){
			var?send?=?document.getElementById('send'),
				times?=?60,
				timer?=?null;
				send.onclick?=?function(){
					//計時開始
					timer?=?setInterval(function(){
						send.value?=?times?+?"秒后重試";
						send.setAttribute('disabled','disabled');
						times--;
						if(times?<=?0){
							send.value?=?"發送驗證碼";
							send.removeAttribute('disabled');
							clearInterval(timer);
							times?=?60;
						}
					},1000);
				}
		}
	</script>
</head>
<body>
	
	<input?type="button"?id="send"?value="發送驗證碼"/>
	
</body>
</html>

沒有1秒后重試,而是直接跳到發送驗證碼,這是什么情況,是哪里有問題呢,求解一下。

正在回答

1 回答

?times--;

if(times < 0){ //你這里出錯了

...

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

倒計時到2秒 就沒了,求解

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號