<html>
<head>
<style>
#box{
width: 1300px;
margin: 100px auto;
color: red;
font: 28px/30px "simsun";
text-align: center;
border: 1px solid red;
}
</style>
</head>
<body>
<div id="box">
五秒之后跳转到 <a href="http://www.baidu.com">百度</a>
</div>
</body>
<script>
var num = 5;
var box = document.getElementById("box");
function fn() {
num -- ;
box.innerHTML = num + "秒后将跳转到 <a href='http://www.baidu.com'>百度</a> ";
if (num == 0){
clearInterval(timer);
location.href = "http://www.baidu.com"
}
}
var timer = setInterval(fn,1000);
</script>
</html>