js之定时器
2021-04-11 00:28
阅读:748
YPE html>
标签:function cti cli rip lang def htm ext alt
定时器
#id1{
width:150px;
height:20px;
}
function showtime(){
var current=new Date().toLocaleString();
var elem=document.getElementById(‘id1‘);
elem.value=current;
}
begin()
var clock
function begin(){
if (clock==undefined)
{ showtime()
clock=setInterval(showtime,1000);
}
}
function end(){
clearInterval(clock)
clock=undefined
}
--------------------------------------------------------------
js之定时器
标签:function cti cli rip lang def htm ext alt
原文地址:https://www.cnblogs.com/cxydnxs/p/12420230.html
下一篇:git上传命令步骤
评论
亲,登录后才可以留言!