第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

怎么不能實(shí)現(xiàn)呢

<!doctype html>
<html>
<head>
??? <meta charset="UTF-8">
?<title>Document</title>
??? <style>
??????? #receive{display:none;}
???????
??? </style>
?<script type="text/javascript">
?window.onload=function(){
???? var send=document.getElementById('send'),
??????????? receive=document.getElementById('receive'),
???????? times=60,
???????? timer=null;
???? send.onclick=function(){
?????? // 計(jì)時(shí)開始
????????? timer=setInterval('showTime',500);????????
???? }
??????? function showTime(){
??????????? if(times>=0){
????????????? receive.style.display='block';
??????????????? receive.disabled ='false';
??????????????? receive.value=times+'秒后重試';
??????????????? times--;
????send.disabled='false';
??????????? }
??????????? else{????
????clearInterval(timer);
????? receive.style.display='none';
??????????? }
??????? }
?}
?</script>
</head>
<body>
?<input type="button" id="send" value="發(fā)送驗(yàn)證碼" >
??? <input type="button" id="receive" >
</body>
</html>

正在回答

1 回答

setInterval()調(diào)用出錯(cuò)。 正確的調(diào)用方式如下:

?? timer=setInterval('showTime()',500);??????? 或 ?? timer=setInterval(showTime,500);????????

定義和用法

setInterval() 方法可按照指定的周期(以毫秒計(jì))來(lái)調(diào)用函數(shù)或計(jì)算表達(dá)式。

setInterval() 方法會(huì)不停地調(diào)用函數(shù),直到 clearInterval() 被調(diào)用或窗口被關(guān)閉。由 setInterval() 返回的 ID 值可用作 clearInterval() 方法的參數(shù)。

語(yǔ)法??? setInterval(code,millisec[,"lang"])?

參數(shù)???? 描述

code ? ?必需。要調(diào)用的函數(shù)或要執(zhí)行的代碼串。 ? ?

millisec ? ?必須。周期性執(zhí)行或調(diào)用 code 之間的時(shí)間間隔,以毫秒計(jì)。 ? ?


0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

怎么不能實(shí)現(xiàn)呢

我要回答 關(guān)注問(wèn)題
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)