Skip to main content

The <option> Element

As defined in the HTML Living Standard, the <option> element represents an option in a <select>, <optgroup>, or <datalist> element.

Visual Example:

<select> <option value="val1">Visible Label 1</option> <option value="val2" selected>Visible Label 2</option> </select> View HTML Living Standard: The option element

Key Attributes

WCAG Requirement: Name, Role, Value

Success Criterion 4.1.2 (Level A): For all user interface components, the name and role can be programmatically determined; states, properties, and values that can be set by the user can be programmatically determined.

The <option> element provides the "Value" part of this requirement. Assistive technology relies on the relationship between the <select> (the role) and its <option> children to present a list of choices. When a user navigates the list, the "state" (whether an option is selected or disabled) is communicated programmatically.

Understand SC 4.1.2: Name, Role, Value

Usage in Different Contexts

The behavior of the <option> element changes slightly depending on its parent:

A11y Tip: Concise Text

Keep the text content of your <option> tags concise. Users navigating via screen readers or switch controls benefit from clear, brief labels that don't require listening to long strings of text before reaching the next choice.