如何在单击时将href设置为复选框
How to set href to a checkbox on click?
1.如何在单击时将href设置为复选框
<a href="/Demo/sense/show/4">
<input type="checkbox" />Yes
</a>
<a href="/Demo/sense/list">
<input type="checkbox" />NO
</a>
但当我选中复选框时。。它不会转到另一页。。
2.如何在点击YES文本而不是YES复选框时设置复选框请帮帮我。。Thanx
<input type="checkbox" onclick='window.location.assign("/Demo/sense/show/4")'/>Yes
也许是这样的?
<input id="cb" type="checkbox" onchange="window.location.href='http://google.com/'">
也许还有一个标签:
<label for="cb">Yes</label>
只需简化代码即可:
<input type="checkbox" id="chk1" />Yes
<input type="checkbox" id="chk2" />NO
<script type="text/javascript">
$(document).ready(function(){
$('#chk1').click(function(){
window.location='http://www.yahoo.com'; // link of your desired page.
});
});
</script>
相关文章:
- 如何将href设置为不同的值
- 设置location.href在<a>点击
- 测试iFrame的位置.href是在jasmine单元测试中设置的
- href属性在页面加载后拒绝重新设置
- 使用JQuery从包含A href值中设置*all*IMG-src值
- 设置文档位置href会阻止设置cookie
- 将 href 样式设置为按钮
- 为什么jQuery attr('href','#')设置了一个空值而不是#
- window.location.href未设置查询参数
- 动态设置 href 标记
- 如何为 href 背景设置替代颜色
- 在 envjs 中设置相对 window.location.href
- 如何使用 javascript 函数设置 href 参数值
- 在 Twitter Bootstrap 3.0 中动态设置弹出框值,并在滚动更新时使用 href
- 角度 - 通过功能有条件地设置 ng-href
- 如何在单击时将href设置为复选框
- 使用angularjs将svg中的xlink:href设置为base64编码的图像
- 对其href设置为另一个元素的id的nav项应用活动类
- 如何将HREF设置为来自输入字段和选择列表的文本?
- 将href设置为超链接文本