<table>
<tr>
<td width="120" height="25" bgcolor="#AEAEDE" onmouseover="javascript: this.style.backgroundColor = '#DEDEDE';" onmouseout="javascript: this.style.backgroundColor = '#AEAEDE';">
</td>
</tr>
</table>

解决方案 »

  1.   

    把这段写入到<script>中
    function
    scbg(objRef, state)
    {
    objRef.style.backgroundColor = (1 == state) ? '#333333' : '#000000'; return;
    }
    在html中,用table调用!
     <table width="100%" border="0" cellpadding="0" cellspacing="0" onMouseOut="scbg(this, 0);" onMouseOver="scbg(this, 1);" >
      

  2.   

    <script language="JavaScript">
    <!--
    var curOverRow=null;
    var curClkRow=null;
    function mouseover(objTr){
    if(objTr==curClkRow) return false;
    if(curOverRow)
    curOverRow.style.backgroundColor="white";
    curOverRow=objTr;
    objTr.style.backgroundColor="#00FF7F";
    }
    function rowClick(objTr){
    if(curClkRow){
    curClkRow.style.backgroundColor="white";
    curClkRow.style.color="black";
    }
    curClkRow=objTr;
    objTr.style.backgroundColor="#0000CD";
    objTr.style.color="white";
     curOverRow=null
    }//-->
    </script>
    <style type="css/text">
    td{text-align:center}
    </style>
    <body>
    <script language="JavaScript">
    <!--
    document.write("<table id='tbTest' cellpadding=0 width=200 cellspacing=0 border=1 style='border-collapse:collapse ' borderColor='#111111'>");
    for(var i=0;i<4;i++){
    document.write("<tr height=30 onmouseover='mouseover(this)' onclick='rowClick(this)'><td width=50 align=center>"+(i+1)+"-1</td><td align=center width=50>"+(i+1)+"-2</td><td align=center width=50>"+(i+1)+"-3</td><td align=center width=50>"+(i+1)+"-4</td></tr>");
    }
    document.write("</table>");
    //-->
    </script>
    </body>
      

  3.   

    <table border=1><tr><td id=aaaaa>mm</td></tr></table>
    <SCRIPT LANGUAGE="JavaScript">
    var e = document.all.aaaaa;
    e.onmouseover = function()
    {
      this.style.backgroundColor = "#80FFF0";
    }
    e.onmouseout = function()
    {
      this.style.backgroundColor = "";
    }
    </SCRIPT>
      

  4.   

    晕,还是web版好,一个小问题引来这么多星
      

  5.   

    <table border=1><tr><td id=aaaaa>1</td></tr></table>
    <button onclick="document.all('aaaaa').bgColor='red'">red</button>