Let’s say you have a checkbox like the following
<input type=”checkbox” id=”leCheckBox”>
To check if it’s checked or not, use:
var leCheckBoxIsChecked = $(“#leCheckBox:checked”).length>0;
It will returns true if the checkbox is checked and false otherwise.
To check the checkbox programmatically:
$(“#leCheckBox”).prop(“checked”, “true”);
To uncheck the checkbox programmatically:
$(“#leCheckBox”).removeAttr(“checked”)