請問我這是錯在哪里 ??快哭了= =
<!DOCTYPE html>
<html>
?<head>
? <title>瀏覽器對象</title> ?
? <meta http-equiv="Content-Type" content="text/html; charset=gkb"/> ??
?</head>
?<body>
? <!--先編寫好網頁布局-->
? <h1>操作成功</h1>
? <p>
? <span id="sec"><strong>5</strong></span>秒后成功<a href="history.back">返回</a>
?</p>
? <script type="text/javascript">?
? var timer=document.getElementById("sec").innerHTML;
? function change(){
? ? ? timer--;
? ? ? document.getElementById("sec").innerHTML=timer;
? ? ? if(timer==0){
? ? ? ? ? window.location.assign("http://idcbgp.cn");
? ? ? }
? ? ? }
? ? ? setInterval("change()",1000);
? ? ??
?</script>?
</body>
</html>
2014-11-25
?
你的代碼里id="sec"里的內空是:<strong>5</strong>,不是5,所以有問題。