<!DOCTYPE html><html>?<head>? <title>瀏覽器對象</title> ?? <meta http-equiv="Content-Type" content="text/html; charset=gkb"/> ??? <style type="text/css">? span{color:red;? }? </style>??</head>?<body>? <!--先編寫好網(wǎng)頁布局-->? <h2>操作成功</h2>? <span id="abc"></span>秒后回到主頁 <span onclick="history.back()">返回</span>?<script type="text/javascript"> ?? ? var num=5;? ? function add(){? ? ? ???document.getElementById("abc").innerHTML=num;? ? ? ? num--;? ? ? ? if(num==0){? ? ? ? ? ? window.location.assign("http://baidu.com")? ? ? ? }? ? }?? ? setInterval(add,1000);? ?//獲取顯示秒數(shù)的元素,通過定時(shí)器來更改秒數(shù)。? ?//通過window的location和history對象來控制網(wǎng)頁的跳轉(zhuǎn)。</script>???</body></html>為什么把innerHTML改成value就不行了呢,最后網(wǎng)頁沒有數(shù)字跳轉(zhuǎn)呢?急急
求大神解答
慕粉2039591405
2017-03-01 11:39:57