<body>
<div id="time"></div>
<a href="#" onclick="stop()">停止</a>
<script type="text/javascript">
var i=3;
function changeTime(){
document.getElementById("time").innerHTML=i;
i--;
}
changeTime();
var inId=window.setInterval("changeTime()",1000);
function stop(){
window.clearInterval(inId);
}
function autoRedirect(){
window.location="j.html";
}
window.setInterval("autoRedirect()",3000);
</script>
</body>
用js在网页上完成倒计时3秒后自动跳转到另一个页面,布布扣,bubuko.com
时间: 2024-10-19 13:43:49