<!DOCTYPE html>
<html>
<head>
<title>浏览器对象</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>
<a href="javascript:count();">宣你</a>或者 把 count 改成 back
<a href="javascript:back();">宣你</a>
back() 未定义...