码迷,mamicode.com
首页 > 其他好文 > 详细

10s倒计时

时间:2017-04-18 15:12:55      阅读:137      评论:0      收藏:0      [点我收藏+]

标签:==   html   java   interval   doc   script   href   ntb   als   

<!DOCTYPE html>
<html>
<meta http-equiv="Content-Type" content="text/html;charset=utf8">
<head>
<title>倒计时</title>
</head>
<body>
请等待<span id="dd">10</span>秒
<script type="text/javascript">
function run(){
var s = document.getElementById("dd");
if(s.innerHTML == 0){
window.location.href=‘#‘;
return false;
}
s.innerHTML = s.innerHTML * 1 - 1;
}
setInterval("run();", 1000);
</script>

 


</body>
</html>

10s倒计时

标签:==   html   java   interval   doc   script   href   ntb   als   

原文地址:http://www.cnblogs.com/ll-taj/p/6727803.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!