检查后,禁用所有其他
HTML:
form
input:radio 1
input:radio 2
input:radio 3
如果单击其中之一,我想禁用其余部分。我认为这里将使用兄弟选择器,但我不知道如何使用。
感谢您的帮助!
HTML:
form
input:radio 1
input:radio 2
input:radio 3
If one of these is clicked, I'd like to disable the rest. I think siblings selector will be used here but I can't figure out how.
Thanks for your help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为您正在尝试禁用其他功能,为此您需要设置无线电输入的disabled=disabled 属性。
示例如下: http://jsbin.com/oquse/2
在此处查看/编辑代码:http://jsbin.com/oquse/2/edit
I think you're trying to disable the others, and for that you need to set the disabled=disabled attribute of the radio input.
Example Here: http://jsbin.com/oquse/2
View/Edit Code Here: http://jsbin.com/oquse/2/edit
您可以使用简单的 javascript + HTML dom 来执行此操作。
单选按钮事件: http://www.hscripts.com/tutorials/ javascript/dom/radio-events.php
使用 JavaScript 函数在 onClick 事件上激活
you can use simple javascript + HTML dom for doing this.
radio button events: http://www.hscripts.com/tutorials/javascript/dom/radio-events.php
use a javascript function to be activated on onClick event