HTML aria-errormessage ARIA Attribute
The aria-errormessage attribute links a form field to the element that holds its error message, which is shown when the field's value is invalid.
Description
The aria-errormessage attribute points to the element that contains the error message for a form field. It is only used while the field also has aria-invalid="true": when the value is valid, the message should not be exposed.
Show the error message element and set aria-invalid="true" when validation fails, then hide the message and remove aria-invalid when the problem is fixed. To make sure the error is announced as soon as it appears, the message can also be a live region, for example with role="alert".
Screen reader support for aria-errormessage has been patchy, so many developers also reference the message with aria-describedby, which is supported everywhere. Using both is safe.
Properties
- Type
- Relationship
- Value
- ID reference list
- Default
- None
- Used with
application,checkbox,combobox,gridcell,listbox,radiogroup,slider,spinbutton,textbox,tree
Syntax
<element aria-invalid="true" aria-errormessage="id">
Values
- ID reference listThe
idof the element that holds the error message.
Example
Browser Support
The following information will show you the current browser support for the aria-errormessage ARIA attribute. Hover over a browser icon to see the version that first introduced support for this ARIA attribute.
Desktop





Tablets & Mobile





