点击按钮(button)打开新窗口(window) |
<div id="box">
<p>页面在<span id="Os">5</span>
s后跳转
</p>
</div>
<script>
var Os=document.getElementById("Os");
var num=5;
var timer=setInterval(function () {
num--;
Os.innerText=num;
if(num==0){
window.location.href="https://www.baidu.com/";
}
},1000)
</script>