页面倒计时跳转

时间:2022-05-18 23:49:45

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<script type="text/javascript">
function timer(){
var t = document.getElementById("t").innerHTML;
if(t>1){
t--;
document.getElementById("t").innerHTML = t;
}else{
window.location.href="http://www.baidu.com";
}
setTimeout('timer()',1000);
}
</script>
</head>
<body onload="timer()">
将在<font id="t" color="#FF0000" size="16">1000</font>秒钟后跳转到百度首页。。。
</body>
</html>