不顯示為啥,不運(yùn)行
<!DOCTYPE html>
<html>
?<head>
? <title>瀏覽器對(duì)象</title>??
? <meta http-equiv="Content-Type" content="text/html; charset=gkb"/>? ?
?</head>
?<body>
? ? ?<h1>caozuo</h1>
? ? ?<span id="second">8</span>
? ? ?<span>xuanni</span>
? ? ?<a href="javascript:back();">宣你</a>
? ? ?<script type="text/javascript">
? ? ? ? ?var num=document.getElementById("second").innerHTML;
? ? ? ? ?function count()
? ? ? ? ?{?
? ? ? ? ? ? ?num--;
? ? ? ? ?document.getElementById("second").innerHTML=num;
? ? ? ? ?if(num==0)
? ? ? ? ?{?
? ? ? ? ? ? ?location.assign("www.baidu.com");
? ? ? ? ?}
? ? ? ? ?}
? ? ?
?</script>?
</body>
</html>
2018-07-04
<a href="javascript:count();">宣你</a>或者 把 count 改成?back
2018-07-04
<a href="javascript:back();">宣你</a>
back() 未定義...