Which attribute on the input is used to reference inline error or helper descriptions for screen readers?

Study for the CIW User Interface Designer Test. Prepare with flashcards and multiple choice questions; each query provides hints and explanations. Get ready for your exam!

Multiple Choice

Which attribute on the input is used to reference inline error or helper descriptions for screen readers?

Explanation:
When you want screen readers to convey extra information about a field—such as an inline error message or helper text—you connect that text to the input using aria-describedby. This attribute points to one or more elements by their id, and the screen reader will read the description after the input’s label, giving users immediate context about the field’s state or guidance. aria-describedby is the right approach because it specifically references descriptive text that supplements the input, not the label itself. aria-labelledby would pull in the label as the description, which isn’t what you want for errors or helpers. aria-hidden would hide content from assistive tech, which defeats accessibility goals. role=alert on the input misapplies alert semantics to the input itself; alerts are separate regions meant to announce changes, not to describe a field. Example: input id="email" aria-describedby="email-help email-error" <span id="email-help">Use a valid email format.</span> <span id="email-error" role="alert">Invalid email address.</span>

When you want screen readers to convey extra information about a field—such as an inline error message or helper text—you connect that text to the input using aria-describedby. This attribute points to one or more elements by their id, and the screen reader will read the description after the input’s label, giving users immediate context about the field’s state or guidance.

aria-describedby is the right approach because it specifically references descriptive text that supplements the input, not the label itself. aria-labelledby would pull in the label as the description, which isn’t what you want for errors or helpers. aria-hidden would hide content from assistive tech, which defeats accessibility goals. role=alert on the input misapplies alert semantics to the input itself; alerts are separate regions meant to announce changes, not to describe a field.

Example: input id="email" aria-describedby="email-help email-error"

Use a valid email format.

Invalid email address.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy