Web APIs
HTMLInputElement.defaultChecked
Reflect the checked attribute rather than the current checkedness of a checkbox or radio control. Example console output: true false.
Formal Syntax & Structure
javascript syntaxjavascript
input.defaultCheckedReturn Value
boolean
Default checked state.
Working Example
Example Snippetjavascript
const i=document.createElement("input"); i.type="checkbox"; i.defaultChecked=true; i.checked=false; console.log(i.defaultChecked,i.checked);