Checkbox 在jquery mobile中强制选中一个单选框的值

Checkbox 在jquery mobile中强制选中一个单选框的值,checkbox,jquery-mobile,Checkbox,Jquery Mobile,在jquerymobile中,如何强制检查无线框的值? 我认为这与class=ui-btn-active有关 <input type='radio' name='myradio' id='radio-choice-1' value='1' /><label for='radio-choice-1'>Station 1</label> <input type='radio' name='myradio' id='radio-choice-2' checke

在jquerymobile中,如何强制检查无线框的值? 我认为这与class=ui-btn-active有关

<input type='radio' name='myradio' id='radio-choice-1' value='1' /><label for='radio-choice-1'>Station 1</label>
<input type='radio' name='myradio' id='radio-choice-2' checked value='2' /><label for='radio-choice-2'>Station 2</label> 
<input type='radio' name='myradio' id='radio-choice-3' value='3' /><label for='radio-choice-3'>Station 3</label> 
站1
车站2
车站3

我不知道你所说的“强制”是什么意思-你是在问如何通过编程更改单选按钮的状态吗?使用jQuery Mobile,您必须在更新单选按钮的属性后刷新该按钮,才能更新其UI:

还请注意,对于HTML4,例如禁用的
和选中的
在启用时将其名称作为值。因此,简单地输入
checked
是无效的,但必须改为
checked='checked'

$("input[type='radio']").attr("checked",true).checkboxradio("refresh");