try
document.getElementById("divid").style.display = "none";

解决方案 »

  1.   

    <SCRIPT>
    function hide(){
      document.getElementById("showmenu").style.display = "none";
    }
    </SCRIPT><body text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginhigh="2" onload=hide();>
    <table width="100%" border="0" cellspacing="1" cellpadding="1" align=center bgcolor=black><tr>
    <div id="showmenu" name="showmenu" style=""><td width=15% bgcolor="#ADB0EC" height=16 align=center>
    <img title="显示菜单栏" border="0" src="images/showmenu.gif" />
    <a href="#" onclick="showmenu();"><font  color="#000000">显示菜单栏</font></a></td></div>
    <script>
    var innerHTML = '';
    for (i=0; i<MAXMENUSHORTNUM; i++) {
      innerHTML = innerHTML +  '<td width=15% bgcolor="#ADB0EC" height=30 align=center>';
      innerHTML = innerHTML +  '<a href="#"  onclick="returnRunScript(' + i + ')">';
      innerHTML = innerHTML +  '<font color="#000000">';
      innerHTML = innerHTML +  arrName[i];
      innerHTML = innerHTML +  '</font></a></td>';
    }
    innerHTML = innerHTML +  '<td width=15% bgcolor="#ADB0EC" height=16 align=center><a href="./MenuShortInput.jsp" target="fraInterface"><font color="#000000">定制快捷菜单</font></a></td>';
    innerHTML = innerHTML +  '</tr></table>';
    document.write(innerHTML);  
    </script>
      

  2.   

    你的div怎么能括住td呢,只能在td里
      

  3.   

    放在td里面怎么隐藏td阿?就是不想显示那部分
      

  4.   

    td也可以隐藏:tdId.style.display='none';
      

  5.   

    试试showmenu.style.visibility="visible"显示
    showmenu.style.visibility="hidden"隐藏