网页上有10秒倒计时,完了后就自动跳转到另一个网页上html代码?

需要网页上有10秒倒计时,完了后就自动跳转到另一个网页的html代码?

用html代码的话就这样:
<meta http-equiv="Refresh" content="10;URL=http://www.baidu.com">
把它加到head标签下
但是不能实现倒计时效果,如果要实现倒计时的话就要用flash,或者javascript,我把带js的html代码发给你自己粘贴到记事本试试吧
<html>
<head>
<title>10秒后跳转</title>
</head>

<body>
<input type="text" readonly="true" value="10" id="time">
</body>
<script language="javascript">
var t = 10;
var time = document.getElementById("time");
function fun(){
t--;
time.value = t;
if(t<=0){
location.href = "http://www.baidu.com";
clearInterval(inter);
}
}
var inter = setInterval("fun()",1000);
</script>
</html>
已经过本人测试了,忘满意
温馨提示:答案为网友推荐,仅供参考
第1个回答  2018-04-12
使用JS代码如下:
var t=document.getElementByID('countdown');
t.innerText="开始倒计时";
setTimeout(function(){
var s=t.innerText;
if(s=="0"){
location.href="另一个网页的地址"
}else{
t.innerText=+s-1
}
},1000);本回答被网友采纳
第2个回答  2010-04-28
光html不行,得js来实现(倒计时 + 页面跳转,这是两个功能)
到网上找下相关的js代码实现吧
第3个回答  2018-08-31
后端代码response.setheader("refresh","2;URL")
第4个回答  2010-04-29
<meta http-equiv="Refresh" content="10;URL=http://www.baidu.com">