← TechnologyThe essentials of

:checked follows the current state of the selection

Publisher: ResumeMaker • 1 source

Published: 22 Oct 2026 13:13 · Updated: 22 Oct 2026 13:13

AI source check: 21 Oct 2026 13:48. This is not editorial approval.

In a few sentences

In brief

The selector reflects the interaction, not just the original HTML attribute.

Useful to know

:checked selects checked checkbox and radio controls, as well as selected option elements. The state changes when the user interacts. [1]

Example: input:checked + label { font-weight: bold; }. It works when label is the immediate next neighbor. The [checked] selector checks the presence of the HTML attribute and is not equivalent to the current state. Don't just use a color change to show the choice; leave a comprehensible sign or the appropriate native control. Thus, the visual feedback corresponds to the real value.

Sources

For further detail and to check the information:

  1. [1] MDN — :checked ↗