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

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

為什么我的代碼沒有用

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>計(jì)時(shí)器</title>

<script type="text/javascript">
? var num=0;
? var i;
? function startCount(){
??? document.getElementById('count').value=num;
??? num=num+1;
??? i=setTimeout("startCount()",1000);
? }
? function stopCount(){
? clearTimeout(i);
? }
</script>
</head>
<body>
? <form>
??? <input type="text" id="count" />
??? <input type="button" value="start"onclick="startCount"? />
??? <input type="button" value="stop" onclick="stopCount"? />
? </form>
</body>
</html>


正在回答

4 回答

函數(shù)調(diào)用的不對(duì)

<input type="text" id="count" />

? ? <input type="button" value="Start" onclick="startCount()" />

? ? <input type="button" value="Stop" onclick="stopCount()"? />


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

把script標(biāo)簽及其內(nèi)容放在input(id是text)標(biāo)簽之后.因?yàn)?html文件加載有順序,先是head后是body.(......后面省略200字)

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

函數(shù)一定不要丟掉了后面的括號(hào),因?yàn)橛械臅r(shí)候括號(hào)里面是需要參數(shù)的,也不一定是個(gè)函數(shù)就有參數(shù),但是startCount()這樣寫才是一個(gè)完整的函數(shù)。。所有onclick調(diào)函數(shù)的時(shí)候加上括號(hào)就可以了。。

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

下面的onclick調(diào)用函數(shù)時(shí)記得加()雙括號(hào),你加上括號(hào)在試一下。。

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

舉報(bào)

0/150
提交
取消

為什么我的代碼沒有用

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

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

幫助反饋 APP下載

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

公眾號(hào)

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