<table>
<tr>
<td onmouseover=this.style.backgroundColor='#FFFFCC' onmouseoutthis.style.backgroundColor='#DDDDDD'><a href="#">TDTDTD</A></td>
<td onmouseover=this.style.backgroundColor='#CCCCCC' onmouseout=this.style.backgroundColor='#EEEEEE'><a href="#">tdtdtd</A></td>
</tr>
</table>
<tr>
<td onmouseover=this.style.backgroundColor='#FFFFCC' onmouseout=this.style.backgroundColor='#DDDDDD'><a href="#">TDTDTD</A></td>
<td onmouseover=this.style.backgroundColor='#CCCCCC' onmouseout=this.style.backgroundColor='#EEEEEE'><a href="#">tdtdtd</A></td>
</tr>
</table>在 onmouseover和onmouseout后加 this.style.backgroundColor='#EEEEEE' (backgroundColor后是颜色值)
我不做asp已经好久了.
function tdMOver(obj)
{
obj.style.color = "red";
}
function tdMOut(obj)
{
obj.style.color = "blue";
}
</script>
<table>
<tr>
<td onmouseover="tdMOver(this)" onmouseout="tdMOut(this)" style="cursor:hand">TDTDTD</td>
<td onmouseover="tdMOver(this)" onmouseout="tdMOut(this)" style="cursor:hand">tdtdtd</td>
</tr>
</table>
<tr>
<td id='test' onmouseover=this.style.backgroundColor='#FFFFCC' onmouseoutthis.style.backgroundColor='#DDDDDD'><a href="#">TDTDTD</A></td>
<td onmouseover="this.innerHTML='<a href=\'#\'><font color=red>tdtdtd</font></A>'" onmouseout="this.innerHTML='<a href=\'#\'><font color=blue>tdtdtd</font></A>'"><a href="#">tdtdtd</A></td>
</tr>
</table>
function tdMOver(thisObj){
thisObj.style.color="#ff0000";
}
function tdMOut(thisObj){
thisObj.style.color="#000000";
}
</script>
<table>
<tr>
<td><a href="#" onmouseover="tdMOver(this)" onmouseout="tdMOut(this)">TDTDTD</A></td>
<td><a href="#" onmouseover="this.style.color='#ff0000';" onmouseout="this.style.color='#000000';">tdtdtd</A></td>
</tr>
</table>你改变的是<a>的颜色!如要改变<td>同理!
你可以利用样式改变<a>的颜色(A:link A:visited A:hover A:active等属性)
<td onmouseover="tdMOver(this)" ...var curTd=null;
function tdMOver(Obj){
if(curTd) Obj.bgColor="#XXXXXX";//自己定义颜色
Obj.bgColor="#FFFFFF";
curTd=Obj;
}
即便是多个页面调用同一个CSS,同一个function就可以了