希望<TD>当鼠标移过去的时候变颜色,并且鼠标是手型的,谢谢 定义一个样式表,然后在<td onmouseover=this.className='s1';>s1为你定义的样式表 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML><HEAD><TITLE> New Document </TITLE><META NAME="Generator" CONTENT="EditPlus"><META NAME="Author" CONTENT=""><META NAME="Keywords" CONTENT=""><META NAME="Description" CONTENT=""></HEAD><BODY><script language="javascript">function changecolor(obj,mousekind){ for(var i=0;i<obj.parentElement.parentElement.parentElement.rows.length;i++){ obj.parentElement.parentElement.parentElement.rows[i].style.backgroundColor=''; } var tdid=obj.parentElement; //取得所在tr //alert(tdid.tagName) if(mousekind == "over"){ tdid.style.backgroundColor = "CornflowerBlue"; } else{ tdid.style.backgroundColor = ""; }}</script><table width="500" border="1"> <tr> <td style="cursor:hand" onMouseOver="changecolor(this,'over')" onMouseOut="changecolor(this,'out')"> </td> </tr> <tr> <td style="cursor:hand" onMouseOver="changecolor(this,'over')" onMouseOut="changecolor(this,'out')"> </td> </tr> <tr> <td style="cursor:hand" onMouseOver="changecolor(this,'over')" onMouseOut="changecolor(this,'out')"> </td> </tr></table></BODY></HTML> <td style="cursor:hand;" onMouseOver="this.bgColor='#ff0000';" onMouseOut="this.bgColor='';">测试一下</td> <table width="170" height="72" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="173" style="cursor: hand" onmouseover="this.bgColor='#FFFFF0'" onmouseout="this.bgColor=''">青岛嘉宏机械有限公司</td> </tr> <tr> <td style="cursor: hand" onmouseover="this.bgColor='#FFFFF0'" onmouseout="this.bgColor=''">青岛嘉宏国际货运有限公司</td> </tr> <tr> <td style="cursor: hand" onmouseover="this.bgColor='#FFFFF0'" onmouseout="this.bgColor=''">青岛嘉宏旅游度假山庄</td> </tr> <tr> <td style="cursor: hand" onmouseover="this.bgColor='#FFFFF0'" onmouseout="this.bgColor=''">香港捷丰投资有限公司</td> </tr> </table> 最简单的 <td onMouseOver="this.bgColor='#0066cc';" onMouseOut="this.bgColor='#ffffff';">fff</td> <td onMouseOver="this.bgColor='#000000';" onMouseOut="this.bgColor='#ffffff';">黑变白</td> IE9下的如何动态创建一个表格 如何勾选checkbox后统计个数? 多重弹出窗口位置问题? js 求一个简单的js 动态改变iframe的src 用javascript怎么做 如何用控制样式表的位置 如何使iframe的高度等于iframe页面的高度 100高分求思路 我没有用过iframe,请问能用iframe实现这样的功能吗,高手快来!!! 怎样使ie的图标成为自己的图标? 请问在 HTC 中如何定义window.onresize() 事件? 请问text框能否自增长??
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD><BODY>
<script language="javascript">
function changecolor(obj,mousekind)
{
for(var i=0;i<obj.parentElement.parentElement.parentElement.rows.length;i++){
obj.parentElement.parentElement.parentElement.rows[i].style.backgroundColor='';
}
var tdid=obj.parentElement; //取得所在tr
//alert(tdid.tagName)
if(mousekind == "over"){
tdid.style.backgroundColor = "CornflowerBlue";
}
else{
tdid.style.backgroundColor = "";
}
}
</script>
<table width="500" border="1">
<tr>
<td style="cursor:hand" onMouseOver="changecolor(this,'over')" onMouseOut="changecolor(this,'out')"> </td>
</tr>
<tr>
<td style="cursor:hand" onMouseOver="changecolor(this,'over')" onMouseOut="changecolor(this,'out')"> </td>
</tr>
<tr>
<td style="cursor:hand" onMouseOver="changecolor(this,'over')" onMouseOut="changecolor(this,'out')"> </td>
</tr>
</table>
</BODY>
</HTML>
<tr>
<td width="173" style="cursor: hand" onmouseover="this.bgColor='#FFFFF0'" onmouseout="this.bgColor=''">青岛嘉宏机械有限公司</td>
</tr>
<tr>
<td style="cursor: hand" onmouseover="this.bgColor='#FFFFF0'" onmouseout="this.bgColor=''">青岛嘉宏国际货运有限公司</td>
</tr>
<tr>
<td style="cursor: hand" onmouseover="this.bgColor='#FFFFF0'" onmouseout="this.bgColor=''">青岛嘉宏旅游度假山庄</td>
</tr>
<tr>
<td style="cursor: hand" onmouseover="this.bgColor='#FFFFF0'" onmouseout="this.bgColor=''">香港捷丰投资有限公司</td>
</tr>
</table>