setInterval(mytime,1000);
function mytime() {
let d = new Date();
document.getElementById('demo').innerHTML =
d.getHours() + ":" +
d.getMinutes() + ":" +
d.getSeconds();
}
JS 回调,每秒回调一次
最新推荐文章于 2024-09-03 17:02:58 发布
setInterval(mytime,1000);
function mytime() {
let d = new Date();
document.getElementById('demo').innerHTML =
d.getHours() + ":" +
d.getMinutes() + ":" +
d.getSeconds();
}