onClick event handlers must have role

Rule ID Widget 2
Definition Elements with onClick event handlers must be a link, button or have a widget role with tabindex.
Purpose
  • Elements with onClick event handlers must be a link, form control or have a widget role.
Mappings
  • HTML5 and ARIA Techniques (Required)
WCAG Success Criteria

4.1.2 Name, Role, Value (Level A, Primary Success Criterion)

Rule Category Widgets/Scripting
Scope Element
Target Resources Elements with onClick event handler values that are defined as widgets
Techniques
  • Use ARIA widget role on non-form controls to describe their function on the page.
Informational Links