var commontop = document.getElementById("commontop");
commontop.onclick = function(ev){
var ev = ev || window.event;
var target = ev.target || ev.srcElement;
if(target.className.toLowerCase() == "h5navbox"){
if(h5navcontent.style.display==='block'){
h5navcontent.style.display = "none";
}else{
h5navcontent.style.display = "block";
}
}
};
target.className 目标元素的className;
类似jquery中的 commontop.on("click",".h5navbox",function(){...})