style.backgroundColor 应该是取 style里的backgroundColor 属性值其他虽然效果一样 但是取 style 取不到 
我是这么理解的

解决方案 »

  1.   

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>无标题文档</title>
    <style type="text/css">
    <!--
    .unnamed1 {
    background-color: #0000FF;
    }
    -->
    </style>
    </head><body>
    <table width="200" border="1">
      <tr>
        <td id="aaaa" style="background-color:#ff0000" onMouseOver="javascript:alert(document.getElementById('aaaa').style.backgroundColor)">&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td id="bbbb" bgcolor="#666666" onMouseOver="javascript:alert(document.getElementById('bbbb').bgColor)">&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td id="cccc" class="unnamed1" onMouseOver="javascript:alert(document.styleSheets[0].rules[0].style.backgroundColor)">&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
    </table>
    </body>
    </html>
    哈哈,研究半小时,终于3个都出来了