楼上正解
示例代码
<tr style="background-color:#ddd;" onmouseover="javascript:color=this.style.backgroundColor;this.style.background='red';"onmouseout="this.style.background=color;">PS: 楼主的这种编码风格不好,推荐看一下《Unobtrusive Javascript》
http://www.onlinetools.org/articles/unobtrusivejavascript/index.html
示例代码
<tr style="background-color:#ddd;" onmouseover="javascript:color=this.style.backgroundColor;this.style.background='red';"onmouseout="this.style.background=color;">PS: 楼主的这种编码风格不好,推荐看一下《Unobtrusive Javascript》
http://www.onlinetools.org/articles/unobtrusivejavascript/index.html
var pcolor;
</script>
</HEAD><BODY>
<TABLE>
<TR style="background:#3366FF" onmouseover = "pcolor=this.style.background;this.style.background='red'" onmouseout="this.style.background= pcolor;">
<TD>111111111111111111111111</TD>
</TR>
<TR style="background:#66CC00" onmouseover = "pcolor=this.style.background;this.style.background='#FFCC00'" onmouseout="this.style.background= pcolor;">
<TD>2222222222222222222</TD>
</TR>
</TABLE>