課程
/前端開發(fā)
/JavaScript
/JavaScript進(jìn)階篇
<input type="button" value="點(diǎn)擊暫停" onclick="clearInterval(i)" />
2020-05-09
源自:JavaScript進(jìn)階篇 8-4
正在回答
<!DOCTYPE?HTML>
<html>
????<head>
????????<meta?http-equiv="Content-Type"?content="text/html;?charset=utf-8">
????????<title>計(jì)時(shí)器</title>
????????<script?type="text/javascript">
???????????function?clock(){
?????????????????var?time=new?Date();
?????????????????document.getElementById("clock").value?=?time;
???????????}
???????????var?i;
???????????function?start()?{???
?????????????i?=?setInterval("clock()",100);
???????????i=setInterval("clock()",100);
????????</script>
????</head>
????<body>
??????<form>
??????????<input?type="text"?id="clock"?size="50"??/>
??????????<input?type="button"?value="Stop"?onclick="clearInterval(i)"?/>
??????????<input?type="button"?value="Start"?onclick="start()"?/>
??????????
??????</form>
????</body>
</html>
,,,,
,,,,,,
舉報(bào)
本課程從如何插入JS代碼開始,帶您進(jìn)入網(wǎng)頁動(dòng)態(tài)交互世界
4 回答再加一個(gè)按鈕star,點(diǎn)擊按鈕計(jì)時(shí)器繼續(xù)運(yùn)行怎么實(shí)現(xiàn)呢
2 回答怎么弄停止后繼續(xù),繼續(xù)后還能停止
2 回答時(shí)間停止和繼續(xù)問題,代碼貼在下面,為何先點(diǎn)擊繼續(xù)時(shí)間按鈕就不能停止了,停止按鈕無效了,怎么回事?
1 回答停止之后怎樣再次啟動(dòng)
2 回答再加個(gè)按鈕“刷新”,,,stop停止后,按刷新又可以繼續(xù)計(jì)時(shí),該怎么弄呢?大神們
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2020-06-08
<!DOCTYPE?HTML>
<html>
????<head>
????????<meta?http-equiv="Content-Type"?content="text/html;?charset=utf-8">
????????<title>計(jì)時(shí)器</title>
????????<script?type="text/javascript">
???????????function?clock(){
?????????????????var?time=new?Date();
?????????????????document.getElementById("clock").value?=?time;
???????????}
???????????var?i;
???????????function?start()?{???
?????????????i?=?setInterval("clock()",100);
???????????}
???????????i=setInterval("clock()",100);
????????</script>
????</head>
????<body>
??????<form>
??????????<input?type="text"?id="clock"?size="50"??/>
??????????<input?type="button"?value="Stop"?onclick="clearInterval(i)"?/>
??????????<input?type="button"?value="Start"?onclick="start()"?/>
??????????
??????</form>
????</body>
</html>
2020-05-31
,,,,
2020-05-31
,,,,,,