Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/381.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用javascript代码更改jquery移动单选按钮组?_Javascript_Jquery_Jquery Mobile - Fatal编程技术网

如何使用javascript代码更改jquery移动单选按钮组?

如何使用javascript代码更改jquery移动单选按钮组?,javascript,jquery,jquery-mobile,Javascript,Jquery,Jquery Mobile,在jquerymobile中,我想用javascript代码更改一个无线电组。我有这个: <fieldset data-role="controlgroup" data-type="horizontal" data-mini="true"> <legend>Co-op Department:</legend> <input name="

在jquerymobile中,我想用javascript代码更改一个无线电组。我有这个:

                <fieldset data-role="controlgroup" data-type="horizontal" data-mini="true">
                    <legend>Co-op Department:</legend>
                        <input name="coopdepartment" id="artssciRB" value="Arts & Science" checked="checked" type="radio">
                        <label for="artssciRB">Arts & Science</label>
                        <input name="coopdepartment" id="managementRB" value="Management" type="radio">
                        <label for="managementRB">Management</label>
                        <input name="coopdepartment" id="idsRB" value="IDS" type="radio">
                        <label for="idsRB">IDS</label>
                </fieldset>
但它不起作用。。。有人知道怎么回事吗?不过,它在输入标记上添加了一个checked属性


谢谢。attr()是指实际标记中的HTML属性。您想要使用的不是HTML属性,而是元素的DOM属性。您希望使用
.prop('checked')
而不是
.attr('checked')
当前复选框状态不是它的
attr
,它是
prop

all.prop("checked", false);
应该有用

all.prop("checked", false);