Testing ariaNotify()

A small test page for the WAI-ARIA 1.3 ariaNotify method: an imperative way to tell a screen reader what to announce, without the guesswork of live regions.

Checking for support…

1. Basic call

element.ariaNotify(message). No visible region required, the browser routes it straight to the accessibility API.

2. Priority option

Pass { priority: "high" } or { priority: "normal" } to hint how it should be queued relative to other pending notifications. Support for the priority hint varies by screen reader.

3. ariaNotify vs a live region

Same action, two mechanisms. The live region below needs a visible, pre-rendered empty container that gets its text swapped in. ariaNotify needs neither.

Worth knowing before testing this section: per MDN, aria-live announcements take priority over ariaNotify() announcements. If both are triggered close together, the live region announcement may be spoken first, or may cause the ariaNotify call to be delayed or masked. This is documented, expected precedence, not a bug, if the ordering looks odd when testing both buttons in quick succession, this is likely why.

ariaNotify has no visible output by design, nothing above will change when you click it. Check the call log below to confirm it fired.

4. Calling ariaNotify() on an element

Every example above calls document.ariaNotify(). It's also valid to call ariaNotify() directly on an element instead. The difference isn't just stylistic: per MDN, an element-scoped call uses that element's own lang attribute (or its nearest ancestor's) to choose pronunciation, rather than falling back to the page's default language. document.ariaNotify() always uses the <html> element's lang, or the user agent's default, regardless of where in the page the triggering action happened.

The container below is marked lang="fr", while the rest of this page is English.

If your screen reader and browser support language-aware pronunciation for ariaNotify(), the message should be read with French pronunciation, even though calling this same text via document.ariaNotify() elsewhere on this page would use English pronunciation instead.

Call log

Every ariaNotify call this page makes, for sighted debugging. This log itself is just a plain div, it plays no part in the announcement.

Specifications

ARIANotifyMixin, WAI-ARIA 1.3.

If your browser doesn't support ariaNotify yet, the buttons above fall back to updating the log only, turn on a screen reader and a supporting browser to hear the difference.

Note

Usage can also be blocked by an aria-notify Permission Policy, where blocked, calls fail silently, no error, no exception, and nothing is announced. If a call appears to do nothing despite everything above looking correctly supported, this is worth ruling out.