关于onclick事件

xyunchen0391 2009-03-25 11:43:52
<a HREF="#" ><tr bgcolor="#E6FFFF" height=30 style="cursor: hand" align=center onclick="JavaScript:if(this.style.backgroundColor='#FFFF00'){this.style.backgroundColor=''}else{this.style.backgroundColor='#FFFF00'}">

就是第一点击时变为黄色,再点一次时变回原来的颜色。

上面哪里不对的地方,高手帮我改一下。
...全文
85 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
xyunchen0391 2009-03-25
  • 打赏
  • 举报
回复
谢谢jim8590251

原来这样就可以了。给分
cuidenghong123 2009-03-25
  • 打赏
  • 举报
回复
if里的=号改成 ==
jim8590251 2009-03-25
  • 打赏
  • 举报
回复
第一:颜色要写成小写
第二:if里的=号改成 ==

<table border=1 width=500>
<a HREF="#" > <tr bgcolor="#E6FFFF" height=30 style="cursor: hand" align=center onclick="JavaScript:if(this.style.backgroundColor=='#ffff00'){this.style.backgroundColor='#E6FFFF'}else{this.style.backgroundColor='#FFFF00'}">
<td>
</td>
</tr>
</table>
xyunchen0391 2009-03-25
  • 打赏
  • 举报
回复
第一次看见以后就会了。ASP的东西很多的大哥!等高手来改改吧
liooon 2009-03-25
  • 打赏
  • 举报
回复
<tr>标签可以设置属性和事件的吗?第一次看见这样写的.

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧