<td onmouseover="this.style.background='#FF0';this.style.color='#F60'" onmouseout="this.style.background='#FFF';this.style.color='#000'">test</td>

解决方案 »

  1.   

    <style>
    .over{
    background-color: blue;
        color: red;
    }
    .out{
    background-color: ;
        color: ;
    }
    </style>
    <TABLE >
    <TR>
    <TD onmouseover="over(this)" onmouseout="over(this)">1</TD>
    </TR>
    </TABLE>
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    function over(obj){
    obj.className=(obj.className == "over" ? "out" : "over")
    }
    //-->
    </SCRIPT>
      

  2.   

    在<tr>或<td>加上onmouseover="ChangeMe(this, true)", onmouseout="ChangeMe(this, false)"
    <script language="javascript">
    function ChangeMe( obj, bChange )
    {
         obj.style.backgroundColor = bChange ? "#ff00000" : "";
         obj.style.color = bChange ? "#ff00000" : "";
    }
    </script>
      

  3.   

    <td onmouseover="over(this);" onmouseout="out(this);">test</td>
    <script language="javascript">
    var oldBackgroundColor,oldForeColor;
    function over(oTR){
      oldBackgroundColor = oTR.style.backgroundColor;
      oldForeColor = oTR.style.color;
      oTR.style.backgroundColor='#FF0';
      oTR.style.color='#F60'" 
    }
    function out(oTR){
      oTR.style.backgroundColor=oldBackgroundColor;
      oTR.style.color=oldForeColor;
    }
      

  4.   

    <TABLE width="20%" align="center" border="1" cellpadding="0">
    <TR>
    <TD onmouseover="this.style.color='red';this.style.background='#3399FF';" onmouseout="this.style.color='black';this.style.background='white';">1111111111111111</TD>
    <TD onmouseover="this.style.color='#33FF66';this.style.background='#FF9900';" onmouseout="this.style.color='black';this.style.background='white';">22222222222</TD>
    </TR>
    </TABLE>
      

  5.   

    一下代码存为:笨狼取色器.hta   
      good   luck!   
          
      <html>   
      <head>   
      <meta   http-equiv="Content-Type"   content="text/html;   charset=gb2312">   
      <title>笨狼颜色选择器</title>   
      <style>   
      body,body.*   
      {   
      font-size:12;   
      }   
      span,button,input   
      {   
      margin:2;   
      width:50;   
      border:1px   solid   black;   
      height:18;   
      }   
      A   
      {   
      color:blue;   
      }   
      </style>   
      <SCRIPT   LANGUAGE="vbScript">   
        dim   aaa,counter   
      window.resizeTo   window.screen.availWidth,window.screen.availHeight     
      window.moveTo   0,0   
        
      function   randColor()   
      dim   re,i,ranNum   
      for   i=1   to   3   
      randomize   
      ranNum=hex(int(255*rnd)+1)   
      if(len(ranNum)=1)   then   ranNum="0"   &   ranNum   
      re=re   &   ranNum   
        next   
        randColor   =   "#"   &   re   
        end   function   
            
        sub   test   
      '设置最多产生1000个色块。   
      if   counter>1000   then   exit   sub   
      dim     strHTML   ,color   
      color=randColor()     
      strHTML="<span   style='background-color:"   &   color   &   ";'   onclick='vbs:getColor   me'   title='"   &   color   &     "'></span>"     
      document.body.insertAdjacentHTML   "beforeEnd",strHTML     
      counter   =counter   +1   
        end   sub   
          
      sub   getColor(obj)     
      ipt.value=obj.title   
      ipt.select   
      choice.style.backgroundColor=obj.title   
      window.clipboardData.setData     "Text",ipt.value     
      end   sub   
        
        sub   gogogo     
      aaa=window.setInterval("test","100","VBScript")     
        end   sub   
          
      sub   shutUp     
      window.clearInterval   aaa   
        end   sub   
      </SCRIPT>   
      </head>   
        
      <body>     
      <button   onclick="vbs:gogogo">选美</button>   
      <button   onclick="vbs:shutUp"   >停止</button>   
      <button   onclick="vbs:window.location.reload   "   >刷新</button>   
      <span   id="choice"></span>   
      <input   id="ipt">   
        
      <A   href="http://superdullwolf.cnzone.net">超级大笨狼制作,呜呼!~~君子好色,取之有道:)...</A>   
          
      <hr/>   
      </body>   
      </html>