在td上加下面的代码 或者直接定义一个函数可以多次用 减少代码量
onmouseover="this.background='图片路径'"
onmouseout="this.background='原始图片路径'"

解决方案 »

  1.   

    楼上的老兄错了
    应该是this.style.background='url()';
    不过不知对td、tr或table有效
    楼主的表述不清
    不知道到底是table还是td或是tr还是bodybody里可以有很多元素
    不过例子可以给个
    <div onmouseover="this.style.background='url()';" onmouseout="this.style.background='url()';"></div>其他元素都是类似的
      

  2.   

    【个人意见,仅供参考】<table width=200 height=200>
    <tr>
    <td background="http://www.baidu.com/img/logo-yy.gif" 
    onmouseover="this.background='http://www.google.com/intl/en_ALL/images/logo.gif'" 
    onmouseout="this.background='http://www.baidu.com/img/logo-yy.gif'">
    你好
    </td>
    </tr>
    </table>
      

  3.   

    我试了一下
    要是想整个table换背景就要按2楼仁兄的
    onmouseover="this.style.background='url()';" onmouseout="this.style.background='url()';"
    在td范围换背景按1楼就可以了
    onmouseover="this.background='图片路径'" 
    差一个style但不知为什么?