How to uncheck checkbox using jQuery Uniform library
A simpler solution is to do this rather than using uniform:
$('#check1').prop('checked', true); // will check the checkbox with id check1
$('#check1').prop('checked', false); // will uncheck the checkbox with id check1
This will not trigger any click action defined.
You can also use:
$('#check1').click(); //
This will toggle the check/uncheck for the checkbox but this will also trigger any click action you have defined. So be careful.
EDIT: jQuery 1.6+ uses prop()
not attr()
for checkboxes checked value
Looking at their docs, they have a $.uniform.update
feature to refresh a "uniformed" element.
Example: http://jsfiddle.net/r87NH/4/
$("input:checkbox").uniform();
$("body").on("click", "#check1", function () {
var two = $("#check2").attr("checked", this.checked);
$.uniform.update(two);
});
$("#chkBox").attr('checked', false);
This worked for me, this will uncheck the check box. In the same way we can use
$("#chkBox").attr('checked', true);
to check the checkbox.