HTML checked Attribute
Example
<input type="checkbox" name="demo" value="accept" checked>
<label for="demo"> I accept your cookies</label><br>
<input type="submit" value="Submit" >
Meaning
The checked attribute should be used only for check box <input type="checkbox">and <input radio type="radio"> form controls.
The presence of this attribute indicates that the control should be displayed in its checked state.
Standard Syntax
HTML:<input type="radio|checkbox" checked>,
XHTML:<input type="radio|checkbox" checked/>
Browser Support
Status
Applies to:
The checked attribute can be used on the following element:
Attribute Values
Value | Description |
---|---|
checked | This is a boolean attribute, the presence of a boolean attribute on an element represents the true value, and the absence of the attribute represents the false value. |