With HTML a checkbox is created like this:
<
You need to refresh it after changing its' .prop
, using .checkboxradio('refresh')
. This is the correct way to check checkbox/radio in jQuery Mobile.
Demo
$('.selector').prop('checked', true).checkboxradio('refresh');
Reference: jQuery Mobile API
Straight from the jQ Mobile docs:
$("input[type='checkbox']").attr("checked",true);
You can do:
$('input[name="checkbox-0"]').prop("checked", true).checkboxradio('refresh'); //sets the checkbox
var isChecked = $('input[name="checkbox-0"]').prop("checked"); //gets the status