解决办法:
复制代码 代码如下:
$('input[type=checkbox]').bind('click',function() {
$(this).prop('checked').checkboxradio(refresh); // 绑定事件及时更新checkbox的checked值
});
如果要用js去改变checkbox的值时也要及时刷新。
复制代码 代码如下:
$('input [type=checkbox]').attr('checked',false).checkboxradio(refresh);
$('input [type=checkbox]').attr('checked',false).checkboxradio(refresh);
原因: 因为手动改变它的值后,jquerymobile不能重新渲染。 这样页面显示的值和实际值就不一样了。 (jquerymobile 把form表单元素都隐藏起来,然后用 js添加了一些元素易于美化input, select ,textarea 等元素的效果)
