The checked
attribute on an <input> tag checks (selects) a checkbox or a radio button element.
Clicking the input element will also toggle the check state.
A checked
attribute on an <input> element.
The third checkbox is checked (selected).
<form action="/tutorial/action.html">
<label>Select Colors </label><br />
<input type="checkbox" id="color-red" name="color" value="Red">
<label for="color-red">Red</label><br />
<input type="checkbox" id="color-green" name="color" value="Green">
<label for="color-green">Green</label><br />
<input type="checkbox" id="color-blue" name="color" value="Blue" checked>
<label for="color-blue">Blue</label><br />
<input type="submit" value="Submit">
</form>
The checked
attribute indicates that the input element is checked, i.e. selected.
Clicking the element will toggle, i.e. check or uncheck, the item.
This attribute only applies to these input types:
<input checked>
<input checked="checked">
Value | Description |
---|---|
checked | Use 'checked' (without value) or checked='checked'. Both are valid. |
Two radio <input> elements of which the first one is checked.
<form action="/tutorial/action.html">
<label>Status</label><br />
<input type="radio" id="pending" name="status" value="Pending" checked>
<label for="pending">Pending</label><br />
<input type="radio" id="closed" name="status" value="Closed">
<label for="closed">Closed</label><br />
<input type="submit" value="Submit">
</form>
Here is when checked
support started for each browser:
![]() Chrome
|
1.0 | Sep 2008 |
![]() Firefox
|
1.0 | Sep 2002 |
![]() IE/Edge
|
1.0 | Aug 1995 |
![]() Opera
|
1.0 | Jan 2006 |
![]() Safari
|
1.0 | Jan 2003 |
Back to <input>