which checkbox is checked javascript code example
Example 1: fill checkbox javascript
document.getElementById("checkbox").checked = true;
document.getElementById("checkbox").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");
}
}