如何使一个包含文本的复选框,就像我有一个带有标签“我接受”服务条款“”的复选框,在这个文本中我的服务条款应该是超链接,在点击服务条款文本时,它应该打开另一个HTML页面,我已经使用了下面的代码,但使用此代码其复选框和取消选中复选框,而不是打开超链接。
<input name="checkbox-0 " type="checkbox" data-iconpos="left" id="Chkterms">I accept the <a href="#terms-of-service">Terms of Services</a>. </label>发布于 2013-03-25 21:14:04
调用onchange中的javascript函数并执行该操作
发布于 2013-03-25 21:14:27
移除包装label,以防止单击a标记来选中该框。
有关演示,请参阅此fiddle。
发布于 2013-03-25 21:33:27
确切地说,这段代码对我来说工作得很好,只是修改了它,以便在新页面中打开google.com
<html>
<input name="checkbox-0 " type="checkbox" data-iconpos="left" id="Chkterms">
I accept the <a href="http://google.com" target=_blank>Terms of Services</a>.
</html>https://stackoverflow.com/questions/15615835
复制相似问题