使用jQuery取消选择一组单选按钮 [英] Unselect group of radio buttons using jQuery
本文介绍了使用jQuery取消选择一组单选按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用jQuery,并且我有一组具有相同名称但具有不同值属性的单选按钮。
I'm using jQuery and I have a group of radio buttons all with the same name, but different value properties.
例如:
<input type = "radio" name = "thename" value="1"></input>
<input type = "radio" name = "thename" value="2"></input>
<input type = "radio" name = "thename" value="3"></input>
我想让它们全部未被选中。我的页面的当前状态中有一个被点击。我该怎么做?
I want to make it so they are all unselected. Current state of my page has one of them clicked. How do I do this?
推荐答案
从jQuery 1.6开始, $(radio)。prop (checked,false);
是建议的方法。
As of jQuery 1.6, $("radio").prop("checked", false);
is the suggested method.
这篇关于使用jQuery取消选择一组单选按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文