如何实现当再次单击时二级导航条隐藏起来
window.onload=function(){
var aLi=document.getElementsByTagName('li');
for(var i=0; i<aLi.length; i++) {
aLi[i].onclick = function () {
var aChild = this.getElementsByTagName("ul")[0];
if (aChild.className = "dropdown-menu") {
aChild.className = "";
}
else {
aChild.className = "dropdown-menu";
}
}
}
}
小羊杨
追萌
相关分类