checkbox with checked in html code example
Example 1: html checkbox default checked
<!-- Add checked tag -->
<input type="checkbox" name="vehicle3" value="Boat" checked>
Example 2: fill checkbox javascript
// Check
document.getElementById("checkbox").checked = true;
// Uncheck
document.getElementById("checkbox").checked = false;