onchecked checkbox code example
Example 1: jquery set checkbox checked unchecked
$('.checkbox').prop('checked', true);
$('.checkbox').attr('checked', true);
Example 2: oncheck checkbox javascript
<input type='checkbox' onchange='handleChange(this);'> Checkbox
function handleChange(checkbox) {
if(checkbox.checked == true){
document.getElementById("submit").removeAttribute("disabled");
}else{
document.getElementById("submit").setAttribute("disabled", "disabled");
}
}
Example 3: jquery checkbox unchecked
$("input:radio[name='NAME']:radio[value='VALUE']").attr("checked",true);
$("input:radio[name='NAME']").removeAttr("checked");