前端学习(2856):简单秒杀系统学习之定时器循环显示
作者:互联网
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>javascrip</title>
</head>
<body >
<script>
function show() {
console.log('每过1秒展示');
}
function show2(str) {
console.log(str);
}
function showTime()
{
time = new Date();
hour = time.getHours();
minu = time.getMinutes();
sec = time.getSeconds();
datetime = hour + ":" + minu + ":" + sec
document.getElementById('checkvalue').value = datetime
}
var she;
she = setInterval(showTime, 1000);
clearInterval(she);
//setInterval(show2, 2000, '每过2秒展示');
</script>
<input type="button" id="checkvalue" />
</form>
</body>
</html>
标签:function,定时器,2856,学习,sec,she,time,datetime,minu 来源: https://blog.csdn.net/weixin_43392489/article/details/112059980