高分求浏览器兼容性
<script language="javascript">
function ShowMenu(srcElm) { //v3.0
var MenuTable = document.all["mod"];
var menuList = document.all["sec_menu"];
for (i = 0; i < menuList.length; i++) {
if (MenuTable[i] == srcElm) {
// MenuTable[i].style.background = "#ffffff";
menuList[i].style.display = "";
MenuTable[i].className = "cu1";
}
else {
// MenuTable[i].style.background = "";
menuList[i].style.display = "none";
MenuTable[i].className = "";
}
}
}
</script>
如上代码,求各浏览器都能正常显示!
javascript
function
menu
浏览器
------解决方案-------------------- function ShowMenu(srcElm) { //v3.0
var MenuTable = document.getElementsByName("mod");
var menuList = document.getElementsByName("sec_menu");
for (i = 0; i < menuList.length; i++) {
if (MenuTable[i] == srcElm) {
// MenuTable[i].style.background = "#ffffff";
menuList[i].style.display = "";
MenuTable[i].className = "cu1";
}
else {
// MenuTable[i].style.background = "";
&nbs