ARIA alert Role
The alert role marks an important, usually time-sensitive message, which screen readers announce straight away, interrupting what the user is doing.
Description
The alert role is for an important and usually time-sensitive message, such as "Your session will expire in 2 minutes" or "Payment failed". Content added to an element with this role is announced immediately, interrupting whatever the screen reader is saying. It has an implicit aria-live="assertive" and aria-atomic="true".
The element must be in the page before the message is inserted, or the message must be added together with the role. Alerts don't move focus, so users can carry on with what they were doing. If the user has to respond, use an alertdialog instead.
Because alerts interrupt, they should be rare. For routine updates such as "Saved" or "3 results found", use the gentler status role. Don't use alerts for messages that appear on page load, and avoid alerts that disappear automatically before users can read them.
Properties
- Category
- Live Region
- HTML equivalent
- None
- Accessible name from
- author
- Required parent role
- None
- Required child roles
- None
ARIA Attributes
- Required
- None
- Supported
- None
- Prohibited
- None
- Global
- All global ARIA attributes can also be used, such as
aria-label,aria-labelledby,aria-describedby,aria-hidden.
Syntax
<element role="alert">
Example
Browser Support
The following information will show you the current browser support for the alert ARIA role. Hover over a browser icon to see the version that first introduced support for this ARIA role.
Desktop





Tablets & Mobile





