Web APIs

HTMLInputElement.defaultChecked

Try the free JavaScript compiler

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.defaultChecked

Return 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);
JavaScript Reference