<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<style>
.container {
width: 400px;
height: 200px;
border: 1px solid #000;
margin: 50px 100px;
box-shadow: 0px 0px 0px 15px #999;
}
.box {
width: 170px;
margin: 50px auto;
font-weight: bold;
font-size: 40px;
}
#goNewPage {
margin-left: 50px;
}
#goNewPage span {
color: red;
font-size: 20px;
}
</style>
<body>
<div class="container">
<div class="box">提交成功</div>
<a id="goNewPage" href="http://www.hao123.com">
<span id="timerMinus">5</span> 秒后会自动跳转页面,或者单击直接跳转
</a>
</div>
<script>
function autoJump(count, url) {
document.getElementById('timerMinus').innerHTML = count--;
if (count > 0) {
setInterval('autoJump(' + count + ',\'' + url + '\')', 1000)
} else {
location.href = url
}
}
autoJump(5, 'http://www.hao123.com')
</script>
</body>
</html>