<h2>
<span id="container">5</span>秒钟后页面即将跳转
</h2>
<script>
let num = 5;
var clock = setInterval(function() {
num = --num;
if (num <= 0) {
clearInterval(clock)
location = 'http://www.baidu.com'
}
document.getElementById('container').innerHTML = num
}, 1000)
</script>
js经典实例----倒计时页面跳转效果
最新推荐文章于 2023-10-18 15:00:37 发布