Favorites

ARIA alertdialog Role

alertdialog
ARIA Window RoleThis ARIA role is supported by all modern browsers.
Updated 28th November 2026

The alertdialog role marks a dialog that contains an urgent message and needs a response from the user, such as a confirmation before deleting something.

☕
Enjoying this site?

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

Buy us a coffee

Description

The alertdialog role is a dialog with an alert message that requires a response, such as "Delete this file? This can't be undone", with Delete and Cancel buttons. When it opens, screen readers may announce it with a system alert sound, and they read the message straight away.

It needs an accessible name (with aria-labelledby or aria-label), and the message itself should be linked with aria-describedby so it is read when the dialog opens. When it appears, move focus to one of its controls, usually the least destructive one, keep focus inside while it is open and return it to the triggering element when it closes.

The native <dialog> element handles focus and modality for you; add role="alertdialog" to it when the dialog is an urgent confirmation.

Properties

Category
Window
HTML equivalent
None
Accessible name from
author
Required parent role
None
Required child roles
None

ARIA Attributes

Required
None
Supported
aria-modal
Prohibited
None
Global
All global ARIA attributes can also be used, such as aria-label, aria-labelledby, aria-describedby, aria-hidden.

Syntax

<element role="alertdialog">

Example

<button type="button" onclick="document.getElementById('ad').showModal()">Delete file</button>
<dialog id="ad" role="alertdialog" aria-labelledby="ad-t" aria-describedby="ad-d">
<h2 id="ad-t">Delete file?</h2>
<p id="ad-d">This can't be undone.</p>
<button type="button" autofocus onclick="this.closest('dialog').close()">Cancel</button>
<button type="button" onclick="this.closest('dialog').close()">Delete</button>
</dialog>

Browser Support

The following information will show you the current browser support for the alertdialog 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