Digital Accessibility Index: Learn where the world’s leading brands fall short on accessibility.

See Report

WCAG 2.1 - SC 4.1.2 Name, Role, Value

The name and role of each user interface element on the page should be programatically available, so that assistive technologies can gather information about and interact with them. If standard controls are used in their default manner, this condition will be met. If special controls are used, this condition will fail, because assistive technology would not be able to determine the elements are controls.

Official Requirements:

4.1.2 Name, Role, Value: For all user interface components (including but not limited to: form elements, links and components generated by scripts), the name and role can be programmatically determined; states, properties, and values that can be set by the user can be programmatically set; and notification of changes to these items is available to user agents, including assistive technologies. (Level A)

Note: This success criterion is primarily for Web authors who develop or script their own user interface components. For example, standard HTML controls already meet this success criterion when used according to specification.

How to fix:

  • Don't use scripting to transform static elements, such as a span or an image, into a control; assistive technology would not recognize it as such.
  • If an image is changed via scripting; its alt text should be changed along with it.
  • Use a label element to associate label text with its control
  • Make sure all input elements have a name attribute, even if they're part of a larger construct.

Not sure where to start?

Start with a free analysis of your website's accessibility.