【发布时间】:2013-07-19 13:17:43
【问题描述】:
我在页面上有四个按钮,当我点击其中一个时,我希望它突出显示。
按钮用于将数据传递给控制器。 他们是这样的:
<button name="region" id="region" type="button" onclick="window.location='/project/Viewdata/index/region/1'" class="current">ALL</button>
<button name="region" id="region2" type="button" onclick="window.location='/project/Viewdata/index/region/2'" class="current">1st</button>
【问题讨论】:
-
你不能有两个具有相同 id 的元素!
-
按钮有重定向代码。他们不会在点击后重定向吗?
-
是的,这是我面临的一个问题,因为重定向选项它加载了基本设置
-
有什么理由不使用普通链接?
-
我改变了 id 的 :)
标签: javascript jquery html php