Accessibility · Middle · Question 10 of 75

How should a field error be linked to its input?

Show the answer

Correct answer: aria-invalid="true" plus aria-describedby to the message

Explanation

The state says the value is invalid and the description says why, so the message is read when the field gets focus. aria-errormessage exists but has weaker support.

Further reading

Problem with a question

Accessibility · Middle · question 10

Test yourself

Take the Accessibility · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz