Goal
- Allow technical aids to return a list to the user whose organization is clear to see; and that simplifies moving from one item on the list to another.
- Foster the accurate rendering of complex drop-down lists in every browser.
- Improve the accessibility of content for people with disabilities.
Implementation
Use the optgroup
element to tag thematic groupings of option elements in select
Use the label
attribute of the optgroup element
to display the label for each grouping.
Control
For each drop-down list:
- Open each (
select
) list to identify those which require a grouping ofoption
elements, for example grouping of car models by brands or grouping of cities by administrative area; - Verify, by examining the source code using Firebug, that each series of
option
elements that should be grouped is tagged with theoptgroup
element; - Check that each
optgroup
element has alabel
attribute associating a label relevant to the group of options in question.
Discover Opquast training and certification
The objective of these rules and the Opquast community mission is ‘making the web better’ for your customers and for everyone! Opquast rules cover the key major areas of risk that can negatively affect website users such as privacy, ecodesign, accessibility and security.
Opquast training has already allowed over 19,000 web professionals to have their skills certified. Train your teams, contact us
We offer a 1 hour free discovery module.