vanilla js checkbox if prop is true checked code example
Example 1: javascript check uncheck checkbox
document.getElementById("myCheckBoxID").checked = true; // Check
document.getElementById("myCheckBoxID").checked = false;// Uncheck
Example 2: how to check if input is checked javascript
const cb = document.getElementById('accept');
console.log(cb.checked);