window.onload=tab;
function tab(){
var n=0;
var timer=null;
var div1=document.getElementById("div1");
var div2=document.getElementById("div2");
var div3=div1.getElementsByTagName("li");
var div4=div2.getElementsByTagName("div");
timer=setInterval(function(){
n++;
if(n>=div3.length){
n=0;
}
for(var i=0;i<div3.leght;i++){
div3[i].className="";
div4[i].style.display="none"
}
div3[n].className="active";
div4[n].style.display="block"
},2000)
}
leght这是什么鬼?length