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

日期循环+stop

时间:2014-08-27 12:47:57      阅读:118      评论:0      收藏:0      [点我收藏+]

标签:blog   http   os   io   for   ar   2014   cti   html   

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>自动变换星期</title>
<script>
window.onload = function (){
var i=0;
var oStop=document.getElementById("stop");
var timer = setInterval(function() {
var a=document.getElementById("week");
i++;
if(i>=50) {clearInterval(timer);}
a.value=="星期六"?a.value="星期五":a.value="星期六";
},1000);

oStop.onclick=function(){
i=50;
}
}
</script>
</head>
<body>
<form>
<input type="text" value="星期五" id="week" />
<input type="button" value="stop" id="stop" />
</form>
</body>
</html>

bubuko.com,布布扣

日期循环+stop

标签:blog   http   os   io   for   ar   2014   cti   html   

原文地址:http://www.cnblogs.com/moliwanzi/p/3938956.html

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