点击链接改变背景

flyrat 2004-12-01 08:41:52
一个左菜单栏,点击其中一个链接,当显示当前链接页面时改变颜色以区别其他菜单项。
...全文
61 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
uGain 2004-12-01
  • 打赏
  • 举报
回复
<a href="#" onclick="document.all.tt.style.backgroundColor='red'">red</a>
<a href="#" onclick="document.all.tt.style.backgroundColor='green'">green</a>
<a href="#" onclick="document.all.tt.style.backgroundColor='yellow'">yellow</a>
<div id="tt">show color</div>
ahpo 2004-12-01
  • 打赏
  • 举报
回复
<a href="" onClick="changeColor()">菜单名</a>

Wirte a JavaScript Code While the link is clicked, and in the Js Code you can change what any you want to change

87,993

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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