前端学习(2854):简单秒杀系统学习之settimeout
生活随笔
收集整理的這篇文章主要介紹了
前端学习(2854):简单秒杀系统学习之settimeout
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
<html> <head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>test</title></head>
<body>
<h1><font color=blue> 示范網(wǎng)頁 </font> </h1>
<p></br>
<script>setTimeout("alert('對不起,久等了');", 3000);setTimeout("alert('對不起');",3000);
function clearWord()
{document.title = '';
}
</script><form>
<input type="button" value="在狀態(tài)列顯示文字" onClick="document.title='Hello' ,setTimeout('clearWord()', 3000) " />
</form>
</body>
</html>
<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script>
x = 0
function countSecond( )
{ x = x+1document.fm.displayBox.value=xsetTimeout("countSecond()", 1000)
}
</script> </head>
<body bgcolor=lightcyan text=red> <p> </br><form name=fm>
<input type="text" name="displayBox"value="0" size=4 >
</form><script>
countSecond()
</script>
</body>
</html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title></title></head><body onload="countSecond();"><script>var x = 0;function countSecond(){ if ( x < 20 ) { x = x + 1;document.getElementById("displaySec").value = xsetTimeout("countSecond()", 1000)}}</script><input type="text" id="displaySec" value="0" /></body>
</html>
運行結(jié)果
總結(jié)
以上是生活随笔為你收集整理的前端学习(2854):简单秒杀系统学习之settimeout的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【视频分享】尚硅谷Oracle视频教程
- 下一篇: 前端学习(2830):条件渲染