onMouseOver对象问题 先做一个css然后修改td的.className的值 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 onmouseover="this.bgcolor=red"onmouseout = "this.bgcolor=orange"; 给TR元素 也就是表格行元素加个 鼠标移上和鼠标移出的事件 在事件里面改变行的背景色<table><tr onmouseover="this.style.background='#DDDDDD'" onmouseout = "this.style.background=''">......</tr></table> <!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> <table width=100% style="border-collapse:collapse; table-layout:fixed" border > <tr onmouseover="this.style.background='#DDDDDD'" onmouseout="this.style.background='blue'"> <td width=20% > </td><td> </td> </tr> <tr onmouseover="this.style.background='#DDDDDD'" onmouseout="this.style.background='blue'"> <td width=20%> </td><td> </td> </tr> <tr onmouseover="this.style.background='#DDDDDD'" onmouseout="this.style.background='blue'"> <td width=20%> </td><td> </td> </tr> <tr onmouseover="this.style.background='#DDDDDD'" onmouseout="this.style.background='blue'"> <td width=20%> </td><td> </td> </tr> <tr onmouseover="this.style.background='#DDDDDD'" onmouseout="this.style.background='blue'"> <td width=20%> </td><td> </td> </tr> <tr> <td width=20%> </td><td> </td> </tr> </table> </body></html> 自己分别给onmouseover\onmouseout写一个方法,参数就是tr的实例,function mouseover(obj){ obj.bgcolor=red;}使用时<tr onmouseover="mouseover('#DDDDDD');" > <td width=20%> </td><td> </td> </tr>这样就好一些,注意代码的简单化 怎么取得table里动态创建行里的文本值,checkbox的值以及select的值 速救啊!!!!,jQuery中,如何在单击div时,取消单击事件 调试js,大家都用什么工具呀 鼠标悬停的问题 我在一个页面上跳出一个新的窗口之后,关闭原先的窗口而没有提示。 如體得到字體的值... 急!急!! 国际域名 e999.net 正式启用,兴奋中,散免费邮箱,散分,散代码咯 急求助:JS实现本地文件的复制移动 checkbox与href勾选问题 part 2 XHTML中怎么取scrollLeft的值 请问 :javascript 如何动态改变外部样式链接
onmouseout = "this.bgcolor=orange";
<tr onmouseover="this.style.background='#DDDDDD'" onmouseout = "this.style.background=''">......</tr>
</table>
<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>
<table width=100% style="border-collapse:collapse; table-layout:fixed" border >
<tr onmouseover="this.style.background='#DDDDDD'" onmouseout="this.style.background='blue'">
<td width=20% > </td><td> </td>
</tr>
<tr onmouseover="this.style.background='#DDDDDD'" onmouseout="this.style.background='blue'">
<td width=20%> </td><td> </td>
</tr>
<tr onmouseover="this.style.background='#DDDDDD'" onmouseout="this.style.background='blue'">
<td width=20%> </td><td> </td>
</tr>
<tr onmouseover="this.style.background='#DDDDDD'" onmouseout="this.style.background='blue'">
<td width=20%> </td><td> </td>
</tr>
<tr onmouseover="this.style.background='#DDDDDD'" onmouseout="this.style.background='blue'">
<td width=20%> </td><td> </td>
</tr>
<tr>
<td width=20%> </td><td> </td>
</tr>
</table>
</body>
</html>
function mouseover(obj)
{
obj.bgcolor=red;
}
使用时
<tr onmouseover="mouseover('#DDDDDD');" >
<td width=20%> </td><td> </td>
</tr>
这样就好一些,注意代码的简单化