checkbox checked false code example

Example 1: javascript check uncheck checkbox

document.getElementById("myCheckBoxID").checked = true; // Check
document.getElementById("myCheckBoxID").checked = false;// Uncheck

Example 2: fill checkbox javascript

// Check
document.getElementById("checkbox").checked = true;

// Uncheck
document.getElementById("checkbox").checked = false;

Example 3: how to make checkbox checked in html

<input type="checkbox" checked={props.completed} /> 

#for props completed is true/false , hence if completed is false then checkbox will not be clicked .
# if the checkbox is true it will be will be checked