aria-invalid
An ARIA attribute that marks a form control's current value as failing validation.
In more detail
Screen readers announce the control as invalid. Set it only after validation has run, not while the user is still typing the first time, and pair it with a visible, linked error message.
Related terms
- aria-errormessage — An ARIA attribute that points from an invalid input to the element holding its error message.
- aria-describedby — An ARIA attribute that links an element to other elements, by id, whose text gives it a longer description.
- form control — An element that collects user input, such as a text input, checkbox, switch, select or button.
Taught in
- Actionable Form Primitives: Buttons, Switches & Inputs — Design Systems & Component Engineering
- Automated Accessibility Testing: axe-core & Testing Library — Design Systems & Component Engineering
- useId: Generating Stable Accessible Form Element Identifiers — React 19 & Modern Component Architecture