css:
#nav{width:760px;height:30px;margin:0 auto;}
Javascript:
<script language="javascript">
var nav=document.getElementById("nav").getElementsByTagName("li");
for(i=0;i<nav.length;i++){
nav[i].onmouseover=function(){
this.style.fontWeight="bold";
this.style.overflow="visible";
this.style.background="#666666";
}
nav[i].onmouseout=function(){
this.style.fontWeight="normal";
this.style.background="#999999"
this.style.overflow="hidden";
}
}
</script>
代码:
<div id="nav">
<ul>
<li>
<a href="#">添加</a>
<div id="subNav">
<a href="#">日志</a>&nbsp;&nbsp;
<a href="#">分类</a>&nbsp;&nbsp;
</div>
</li>
</ul>
</div>
</div>
上面代码中的nav.length是什么意思?