Accessibility · Middle · Question 10 of 75
How should a field error be linked to its input?
- 1
aria-hiddenon the message and a red outline on the input - 2
role="error"on the input andtitleon the message - 3
aria-invalid="true"plusaria-describedbyto the message
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.