document.getElementById("menuJobList");
--->
document.all("menuJobList");呢

解决方案 »

  1.   

    错了
    用document.tablename.trname.menuJobList呢/
      

  2.   

    唉!简单点:
    <td id="menuJobList" class="menu-item" width="160" onclick="this.style.backgroundColor='red'">
      

  3.   

    建议你用onmouseover 和 onmouseout
      

  4.   

    我试了kingdomzhf(旭日东升) 提供的方法,对于netscape4.X没有效果。
    document.all document.elementName等好像都是MS扩展的,只适用于IE。hahacc(出師無名) 提的建议,我曾经用过,但和最终的效果还有点差距,
    因为我想实现
      a.在用户选中某菜单后,即使鼠标移开,其背景色也是选中时的背景色,
      b.在点击其他菜单时,刚才被选中的菜单的背景色恢复为初始颜色。
    hahacc的建议只能实现a,对于b好像只能通过javascript访问页面元素实现。sigh!~
      

  5.   

    <td id="menuJobList" class="menu-item" width="160" onmouseover="this.style.backgroundColor='red'" onmouseout="this.style.backgroundColor='white'">
      

  6.   

    ffj521(古剑&#8231;酒),这也不能实现功能b吧?
      

  7.   

    <script>
    var justnow="";
    function reset()
    {
    if(justnow!="")
    eval("document.all."+justnow+".style.backgroundColor='white'")
    }
    </script><td id="menuJobList" class="menu-item" width="160" onmousedown="reset();this.style.backgroundColor='red';justnow=this.id;">
      

  8.   

    xishanlang2001(西山狼2000) ,我试验了一下,你提供的方法在netscape4.X也没有效果。
    可能是因为它不支持document.all
      

  9.   

    yun95791 (云) :
    我沒看清楚!現在知道是怎樣的效果了!但我沒在netscape4.X下實驗,弄個你想要的效果,在IE下是可以的.在netscape4.X下不知道行不行!
    以下是整個頁面的全部代碼:
    <html>
    <head>
    <meta name="GENERATOR" content="Microsoft FrontPage 5.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <meta http-equiv="Content-Type" content="text/html; charset=big5">
    <title>新增網頁1</title>
    <STYLE type=text/css>
    .high {  background-color: #006699; color: #FFFFFF; cursor: default}
    .target {  color: #FFFFFF; background-color: #006699; border: 2px #CCCCCC solid}
    </STYLE>
    <script language="JavaScript">
    function high(ob){
    ob.className=(ob.className=='target')?'target':'high';
    }function low(ob){
    ob.className=(ob.className=='target')?'target':'';
    }function setTarget(){
    for (i=1;i<=3;i++){
    eval('e'+i).className='';
    }
    event.srcElement.className='target';
    }
    </script>
    </head><body>
    <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
      <tr>
        <td width="100%" onMouseOver=high(this) onMouseOut=low(this) onClick=setTarget() id=e1> </td>
      </tr>
      <tr>
        <td width="100%" onMouseOver=high(this) onMouseOut=low(this) onClick=setTarget() id=e2> </td>
      </tr>
      <tr>
        <td width="100%" onMouseOver=high(this) onMouseOut=low(this) onClick=setTarget() id=e3> </td>
      </tr>
    </table>
    </body>
    </html>
      

  10.   

    不好意思,netscape,偶不熟了.
    学习,关注!帮你顶一下