Ensure Role Attribute Has an Appropriate Value for the Element

Photo of Researcher
Yotam Flohr
Researcher
Blind Hearing Mobility
WCAG 2.1 Level A

Written and researched for humans by humans

Photo of Researcher
Yotam Flohr
Researcher
Photo of Expert
Ritvik Shrivastava
Expertly reviewed by
Comments: 0
Your entire domain
Get detailed instructions on how to resolve every accessibility issue on your website

Values assigned to WAI-ARIA role attributes must be valid. Valid attributes are spelled correctly, correspond to existing ARIA role values, and are not abstract roles.

Why It Matters

When screen readers and other assistive technologies do not understand the role of each element on a web page, they are not able to interact with it correctly. When the value for a role is invalid, there is no way to communicate the element’s features, properties, and methods to assistive technologies and in turn, users

Fixing the Issue

Ensure all values assigned to role=”” correspond to valid WAI-ARIA roles.

Available roles by type are:

  • Landmark: article, banner, complementary, main, navigation, region, search, contentinfo
  • Widget: alert, alertdialog, application, dialog, group, log, marquee, menu, menubar, menuitem, menuitemcheckbox, menuitemradio, progressbar, separator, slider, spinbutton, status, tab, tablist, tabpanel, timer, toolbar, tooltip, tree, treegrid, treeitem
  • Pseudo HTML: button, button, checkbox, columnheader, combobox, form, grid, gridcell, heading, img, link, listbox, listitem, option, radio, radiogroup, row, rowgroup, rowheader, scrollbar, textbox
  • Document: document (when creating a document region inside an other type of region)
  • Application: application (only around a widget to enable normal keyboard shortcuts for page content)
  • Presentation: presentation (to cancel the native role of the element)
  • Other Semantic: math, definition, note, directory
  • Abstract: command, composite, input, landmark, range, section, sectionhead, select, structure, widget