javascript checkbox oncheck code example
Example 1: javascript check uncheck checkbox
document.getElementById("myCheckBoxID").checked = true;
document.getElementById("myCheckBoxID").checked = false;
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");
}
}