为什么这个JS在火狐里还是不起作用啊?高手帮帮忙啊
<script language=javascript>
function secBoard(n)
{
var menus = document.getElementById('jfdh_menu');
var mains = document.getElementById('jfdh_display');
for(i=0;i<menus.childNodes.length;i++){
if(menus.childNodes[i].nodeType==1)
menus.childNodes[i].className="button_jfgl";
menus.childNodes[n].className="button_jfgl_1";}
for(i=0;i<mains.childNodes.length;i++){
if(mains.childNodes[i].nodeType==1)
mains.childNodes[i].style.display="none";
mains.childNodes[n].style.display="block";}
}
</script>
在IE就正常的
------解决方案--------------------
JScript code
function secBoard(n){
var menus_childs = document.getElementById('jfdh_menu').children,
mains_childs = document.getElementById('jfdh_display').children;
for(var i=0;i<menus_childs.length;i++){
menus_childs[i].className="button_jfgl";
}
menus_childs[n].className="button_jfgl_1";
for(var i=0;i<mains_childs.length;i++){
mains_childs[i].style.display="none";
}
mains_childs[n].style.display="block";
}