定时跳转:4秒后到百度页面
<body>
<h1>提交成功</h1>
<a href="https://www.baidu.com/?tn=44004473_27_oem_dg"><span id=12>4</span>秒后系统会自动跳转</a>
<script>
var p = document.getElementById("12");
setInterval(fn, 1000);
function fn() {
var time = p.innerHTML;
if (time > 0) {
time--;
p.innerHTML = time;
} else {
window.location.href = "https://tieba.baidu.com/index.html";
}
}
</script>
</body>
运行效果: