Favorites

ARIA alert Role

alert
ARIA Live Region RoleThis ARIA role is supported by all modern browsers.
Updated 28th November 2026

The alert role marks an important, usually time-sensitive message, which screen readers announce straight away, interrupting what the user is doing.

☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee

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

<button type="button" onclick="document.getElementById('err').textContent='Payment failed. Please check your card details.';">Pay now</button>
<div id="err" role="alert" style="color:#b91c1c"></div>

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.

This ARIA role is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported
☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee