checked

The checked boolean attribute sets a checkbox or radio button as initially selected.

Since HTML 2.0 Spec ↗

Syntax

checked

Examples

<input type="checkbox" name="news" checked> Subscribe
<input type="radio" name="plan" value="pro" checked> Pro
Output
Renders the checkbox ticked and the Pro radio button pre-selected.

Notes

This sets the initial state only; the live state is element.checked in JavaScript. Within a radio group only one button should carry checked.

Browser & runtime support

EnvironmentSince version
chrome 1.0
firefox 1.0
safari 1.0
edge 12

See also