--- title: 'ARIA: option role' slug: Web/Accessibility/ARIA/Roles/option_role tags: - ARIA - Accessibility ---
The option
role is used for selectable items in a listbox.
The option
role is used to identify selections a user can make in a listbox. These options are similar to the {{HTMLElement('option')}} elements in a {{HTMLElement('select')}} element, but they can contain images.
All selectable options should have aria-selected
match their state, true
when selected and false
when not. If an option is not selectable, aria-selected
can be omitted. A disabled option can either omit the aria-selected
option and be removed from the focus order, or mark aria-disabled
as true
andzzzzzzzzzzzzzzzzz aria-selected
as false
to show the user that the option is present, albeit disabled.
The option
role is for identifying selectable choices of a listbox
. Options must be provided an accessible name. Generally, the accessible name for an option should come from the element's descendant content. Authors can also explicitly provide an accessible name by specifying aria-label or aria-labelledby to the element with the option
role. If using aria-label
or aria-labelledby
, and the option also displays a visible text label, authors must ensure they adhere to WCAG Success Criterion 2.5.3 Label in Name.
It is highly recommended to use a {{HTMLElement('select')}} element or an {{HTMLElement('input')}} element with the checkbox
or radio
type instead, when possible. These native HTML elements provide keyboard interactivity to manage focus for all the descendants for you automatically.
option
must be contained in or owned by a listbox
true
, false
and mixed
. Optional.aria-posinset
to declare the total number of options. Optional.aria-labelledby
should be used instead. Optional.(For further details and a full list of ARIA states and properties see the ARIA option
(role) documentation.)
Specification | Status |
---|---|
{{SpecName("ARIA","#option","ARIA option role")}} | {{Spec2('ARIA')}} |
{{SpecName("ARIA Authoring Practices","#Option","Option Role")}} | {{Spec2('ARIA Authoring Practices')}} |
combobox
roleoption
rolelist
role