HTML Input checked Attribute

Definition and Usage

The checked attribute specifies if the input is pre-checked (pre selected "on").
This attribute is only used if the type attribute of the input element is set to "checkbox" or "radio".
This attribute is useful for preselecting inputs in a form, or preserving the state of a form selection.


<input checked="checked" />

Attribute Values

Value Description
checked Specifies that the checkbox or radio button is checked.

Browser Support

The attribute is supported in all major browsers.


Source Output
<form action="">
Checked checkbox: <input type="checkbox"
name="cbox" id="cbox" checked="checked" />
Checked checkbox:
HTML Input checked Attribute Reviewed by 1000sourcecodes on 04:09 Rating: 5
Powered by Blogger.