<script language=javascript>
<!--
function changebgColor()
{
var obj=window.event.srcElement;
if(obj.style.backgroundColor=="blue")
{
obj.style.backgroundColor="red";
}
else
{
obj.style.backgroundColor="blue";
}
}
//-->
</script>
<TABLE id="Table1" cellSpacing="1" cellPadding="1" width="300" border="1">
<TR>
<TD onclick="changebgColor()" runat=server>afadsfasdfasdfa</TD><TD onclick="changebgColor()">afadsfasdfasdfa</TD><TD onclick="changebgColor()">afadsfasdfasdfa</TD>
</TR>
</TABLE>
<!--
function changebgColor()
{
var obj=window.event.srcElement;
if(obj.style.backgroundColor=="blue")
{
obj.style.backgroundColor="red";
}
else
{
obj.style.backgroundColor="blue";
}
}
//-->
</script>
<TABLE id="Table1" cellSpacing="1" cellPadding="1" width="300" border="1">
<TR>
<TD onclick="changebgColor()" runat=server>afadsfasdfasdfa</TD><TD onclick="changebgColor()">afadsfasdfasdfa</TD><TD onclick="changebgColor()">afadsfasdfasdfa</TD>
</TR>
</TABLE>
解决方案 »
- 菜单栏怎么实现JS特效,在线等待!!!!!!!
- repeater 嵌套问题急用!!!!
- 博客园的DUDU是一个什么样的人?他是不是博客园的老板?
- 如何在DataGrid的一个模板列中全选/放弃按钮
- 【【【小妹紧急求助:简单之极的正则表达式】】】
- 分页时:如果原先翻页到第5页(共10页),又重新绑定数据源(共1页),这时出错,请问高手...?
- 存储过程问题
- ASPNET_wp.exe
- 在Calendar中click上一月或下一月就自动隐藏了是怎么回事?
- 我想通过代码把同一个htm页面里另外一个框架的aspx页面刷新一下,该怎么做呢?
- 有谁能推荐几个好一点的,用ASP.NET开发出来的网站。
- 能动态调整textbox的大小吗?
<table>
<tbody>
<tr>
<td onclick="this.bgColor='red'" onmouseout="this.bgColor='white'">hello</td>
</tr>
</tbody>
</table>
<td onclick="if (this.bgColor=='#ff0000'){this.bgColor='#0000ff'}else{this.bgColor='#ff0000'}">
....
</td>
....
</table>