Simple Two-State Checkbox Example

Example of a simple two-state checkbox that implements the design pattern for checkbox.

Example

Label 1
Label 2
Label 3

Accessibility Features

Keyboard Support

Key Function
Tab Moves keyboard focus to checkbox.
Space Toggle the checkbox option either true or false. False is the default.

ARIA Roles, Properties, and States

Role Property/State Usage
checkbox Identify div as Checkbox widget.
aria-checked Indicate state of checkbox:
  • Checked (e.g. aria-checked=true)
  • Unchecked (e.g. aria-checked=false)

Javascript and CSS Source Code

HTML Source Code