Rule: onClick event handlers must have widget role

Rule ID Widget 2
Conformance Required
Definition Elements with onClick event handlers must be a link, button or have a widget role.
Purpose
  • Elements with onClick event handlers must be a link, form control or have a widget role.
  • NOTE: This rule can only identify elements using the onclick attribute. There is currently no programatic way to detect elements with click events added using addEventListener.
Conformance Required
WCAG Success Criteria

Success Criterion 4.1.2 Name, Role, Value

Rule Category ARIA Widgets
Rule Scope Element
Techniques
  • Use ARIA widget roles on non-form controls to describe their function on the page.
Information Links