Checking and unchecking radio buttons with Jquery Mobile(使用 Jquery Mobile 选中和取消选中单选按钮)
问题描述
我无法使用 jquery mobile 以编程方式检查一组复选框,我有以下代码:
I can't check a set of checkboxes programatically with jquery mobile, I have the following code:
如果我这样做:$("input[type='radio']:last").attr("checked",true).checkboxradio("refresh");
一切正常,但这些都不起作用:
If I do: $("input[type='radio']:last").attr("checked",true).checkboxradio("refresh");
everything works perfect, but none of this work at all:
如何正确操作这些元素?取消选中所有复选框也可以正常工作:
How can I properly manipulate these elements? Unselecting all checkboxes also works fine:
似乎唯一有效的复选框是最后一个.
It seems that the only checkbox working is the last one.
推荐答案
它们都工作得很好.您只需要在组中的所有 input radio
上触发 refresh
.
They all work just fine. You just need to trigger refresh
on all input radio
in group.
jsFiddle 这里.
这篇关于使用 Jquery Mobile 选中和取消选中单选按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!