我使用Codiqa设计了我的移动应用程序。所以所有的css和js都是从链接加载的。我不知道如何取消选中单选按钮列表中的所有单选按钮。我尝试了许多编码,但它对我不起作用。HTML:
<div data-role="fieldcontain" data-controltype="radiobuttons">
<fieldset data-role="controlgroup" data-type="vertical">
<legend>
Shift
</legend>
<input id="radio1" name="rbtnShift" value="1" data-theme="c" type="radio">
<label for="radio1">
AM
</label>
<input id="radio2" name="rbtnShift" value="2" data-theme="c" type="radio">
<label for="radio2">
PM
</label>
<input id="radio3" name="rbtnShift" value="3" data-theme="c" type="radio">
<label for="radio3">
Night
</label>
</fieldset>
</div>Jquery:
$("input:radio[name='rbtnShift']").each(function (i) {
this.checked = false;
});我试过上面的代码,但它对我不起作用。我当然遗漏了一些基本的东西,但我不知道问题出在哪里。
首先,我选择一个选项

点击按钮后,显示如下所示

发布于 2013-08-15 12:45:35
你可以给他们一个classname,然后试试:
$('.classname').prop('checked', false);https://stackoverflow.com/questions/18246410
复制相似问题