求大神看看这哪错了
这哪里不对啊
这哪里不对啊
2016-07-12
这里你的16行有问题,把value换成innerHtml
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<p><b>操作成功</b></p>
<p><label id="cal" style="display: inline">2</label>秒后返回主页</p>
<a href="#" onclick="goBack()">返回</a>
<script type="text/javascript">
function count() {
var num = parseInt(document.getElementById("cal").innerHTML);
num = num - 1;
setTimeout("count()", 1000);
if(num==0){
window.location.href="http://www.imooc.com";
}
}
count();
function goBack(){
window.history.back();
}
</script>
</body>
</html>
举报