JavaScript Document ariaNotify() Method

Beginner
⏱️ 12 min read
📚 Updated: Jul 2026
🎯 5 Examples
🚀 5 Try-it labs
Limited availability
Instance method

What You’ll Learn

document.ariaNotify() is an instance method that queues text for a screen reader at the document level. Learn priorities, how it compares to ARIA live regions and Element.ariaNotify(), MDN’s shopping-list pattern, and five try-it labs. Support is Limited availability (not Baseline yet).

01

Kind

Instance method

02

Target

Document

03

Priority

normal / high

04

Returns

undefined

05

vs live

No DOM change

06

Status

Limited availability

Introduction

Accessible status updates often use an ARIA live region: set aria-live on an element and change its text so assistive technology announces it. That only works when DOM content changes—and many apps maintain hidden nodes just to trigger speech.

MDN: Document.ariaNotify() queues a string of text to be announced by a screen reader. You can make announcements at any time, with message text independent of visible DOM content. The same ARIANotifyMixin is also available on Element.

💡
Beginner tip

You will only hear announcements if a screen reader is active. Always feature-detect document.ariaNotify, and keep an aria-live fallback for browsers without the method.

Related tutorials: Element.ariaNotify(), append(), Document constructor.

Understanding document.ariaNotify()

Calling document.ariaNotify(text) queues text for assistive technology. It does not change visible page content by itself.

  • It is an instance method on the live page’s document object.
  • Announcements can happen without a DOM update (unlike live regions) (MDN).
  • Message text is defined in the call—independent of node content (MDN).
  • Prefer one combined string over several rapid calls (MDN).
  • No transient activation required—avoid spamming screen reader users (MDN).
  • Permissions Policy aria-notify can block usage silently (MDN).

📝 Syntax

General forms of Document.ariaNotify (MDN):

JavaScript
ariaNotify(announcement)
ariaNotify(announcement, options)

Parameters

  • announcement — a string specifying the text to be announced (MDN).
  • options (optional) — an object that may include:
    • priority"normal" (default: spoken after current speech) or "high" (interrupt immediately) (MDN).

Return value

None (undefined).

Priority vs live regions (MDN)

  • priority: "high"aria-live="assertive"
  • priority: "normal"aria-live="polite"
  • Existing aria-live announcements still take priority over ariaNotify() (MDN).

Common patterns

JavaScript
document.ariaNotify("Saved successfully.");

document.ariaNotify("Error: try again.", { priority: "high" });

// Prefer one combined message (MDN)
document.ariaNotify("Hello there. The time is now 8 o'clock.");

if (typeof document.ariaNotify === "function") {
  document.ariaNotify("Ready");
}

⚡ Quick Reference

GoalCode
Announce textdocument.ariaNotify("Done")
Urgent interruptdocument.ariaNotify(msg, { priority: "high" })
Feature-detecttypeof document.ariaNotify === "function"
FallbackUpdate an aria-live region
Language voiceSet lang on document.documentElement
MDN statusLimited availability; not Deprecated / Experimental / Non-standard

🔍 At a Glance

Four facts about document.ariaNotify().

Returns
undefined

Queues speech only

Availability
limited

Not Baseline yet

Needs AT?
yes

Screen reader hears it

DOM change?
not required

Unlike live regions

📋 ariaNotify() vs ARIA live regions

document.ariaNotify(msg)aria-live region
TriggerAny time from JS (MDN)After DOM content changes
Message sourceArgument stringUpdated node text / content
Hidden live node hackNot neededOften used as a workaround
Urgencypriority normal / highpolite / assertive
Browser supportLimited / rolling outWidely available
Best forDocument-level JS events (MDN demo)Cross-browser status text today

Examples Gallery

Examples follow MDN Document: ariaNotify(). Use a screen reader in supporting browsers to hear announcements.

📚 Getting Started

MDN button announce and safe feature detection on document.

Example 1 — Basic document.ariaNotify() (MDN)

Click a button to queue a document-level screen reader announcement.

JavaScript
document.querySelector("button").addEventListener("click", () => {
  document.ariaNotify("Hi there, I'm Ed Winchester.");
});
Try It Yourself

How It Works

MDN’s official example: the announcement is queued on the document, not on the button element.

Example 2 — Feature Detection

Always check the method exists before calling it.

JavaScript
if (typeof document.ariaNotify === "function") {
  document.ariaNotify("Notification sent.");
  console.log("document.ariaNotify supported");
} else {
  console.log("Not supported — use aria-live fallback");
}
Try It Yourself

How It Works

Limited availability means many browsers still lack the method. Detection avoids TypeError.

📈 Practical Patterns

High priority, combining messages, and MDN’s shopping-list demo.

Example 3 — priority: "high"

Interrupt-style announcements for urgent errors (like assertive live regions).

JavaScript
document.ariaNotify("Session expired. Please sign in again.", {
  priority: "high"
});
Try It Yourself

How It Works

MDN: high priority speaks immediately, interrupting current speech. Use sparingly.

Example 4 — Combine Messages (MDN Advice)

Prefer one string over back-to-back calls.

JavaScript
// Less reliable across AT (MDN):
// document.ariaNotify("Hello there.");
// document.ariaNotify("The time is now 8 o'clock.");

// Better — one announcement
document.ariaNotify("Hello there. The time is now 8 o'clock.");
Try It Yourself

How It Works

MDN: some screen readers may only speak the latest call. Combining keeps the full message together.

Example 5 — MDN shopping list pattern

Announce item added and updated total with document.ariaNotify() (MDN demo).

JavaScript
let total = 0;

form.addEventListener("submit", (e) => {
  e.preventDefault();
  total += Number(price.value);
  updateTotal();

  document.ariaNotify(
    `Item ${item.value}, price £${price.value}, added to list. Total is now £${total.toFixed(2)}.`,
    { priority: "high" }
  );
});
Try It Yourself

How It Works

MDN’s shopping-list demo uses document-level announces for add/remove events with combined item + total text.

🚀 Common Use Cases

  • App-wide status — save, submit, or navigation feedback without a visible status node.
  • Shopping / todo lists — MDN demo: announce item + running total on add/remove.
  • Validation errorspriority: "high" for urgent messages.
  • Replacing hidden live nodes — avoid off-screen aria-live hacks.
  • When Element target is unclear — document-level announce for global events.
  • Progressive enhancement — pair with aria-live fallback until Baseline coverage grows.

🧠 How document.ariaNotify() Announces

1

Call on document

Pass announcement text (and optional priority) to the Document (MDN).

Call
2

Browser queues the message

Permissions Policy aria-notify may block silently (MDN).

Queue
3

Screen reader speaks

Voice/language follows lang on the document or nearest ancestor (MDN).

Speak
4

Return undefined

No promise—feature-detect and test with real assistive tech.

📝 Notes

  • MDN: Limited availability (not Baseline)—feature-detect before production use.
  • Not Deprecated, Experimental, or Non-standard — WAI-ARIA ARIANotifyMixin.
  • Same API as Element.ariaNotify().
  • Permissions Policy aria-notify can block announcements silently (MDN).
  • Language/voice uses lang on the document element or UA default (MDN).
  • Related: Element.ariaNotify(), append(), Document().

Browser Support

Document.ariaNotify() is Limited availability on MDN (not Baseline). Logos use the shared browser-image-sprite.png sprite from this project. Support is rolling out (for example full support in recent Firefox; partial in some Chromium builds). Always feature-detect.

Limited availability · Not Baseline

Document.ariaNotify()

Standard-track accessibility API. Keep an aria-live fallback until Baseline coverage improves.

Limited Not Baseline yet
Mozilla Firefox Supported (from 150+)
Yes
Google Chrome Partial / platform-dependent
Partial
Microsoft Edge Partial (Chromium mirror)
Partial
Opera Partial (Chromium mirror)
Partial
Apple Safari Not supported (check updates)
No
Internet Explorer Not supported
No
ariaNotify() Growing

Bottom line: Use document.ariaNotify() where supported for document-level JS announcements. Feature-detect and fall back to ARIA live regions for broad compatibility.

Conclusion

document.ariaNotify() queues screen reader announcements at the document level without requiring a DOM text change. Prefer combined messages, use high priority sparingly, and always feature-detect with an aria-live fallback while support remains limited.

Continue with browsingTopics(), ownerDocument, or the JavaScript hub.

💡 Best Practices

✅ Do

  • Feature-detect document.ariaNotify before calling
  • Combine related messages into one string (MDN)
  • Keep a polite live-region fallback
  • Set lang on document.documentElement when language matters
  • Test with a real screen reader in supporting browsers

❌ Don’t

  • Spam users with frequent high-priority notifies (MDN)
  • Assume every browser supports the API yet
  • Rely on multiple rapid calls being spoken in order (MDN)
  • Expect a return value or promise
  • Ignore Permissions Policy aria-notify blocks

Key Takeaways

Knowledge Unlocked

Five things to remember about document.ariaNotify()

Document-level AT speech from JS—feature-detect and fall back.

5
Core concepts
🔊02

Queues

AT speech

A11y
03

Priority

normal / high

Urgency
🔍04

Support

limited

Status
🛡05

Fallback

aria-live

Today

❓ Frequently Asked Questions

It queues a string of text to be announced by a screen reader at the document level. You can call it at any time — announcements do not require a DOM content change like classic ARIA live regions (MDN).
No. MDN marks it as Limited availability (not Baseline). It is defined in the WAI-ARIA ARIANotifyMixin specification — not Deprecated, Experimental, or Non-standard.
Both share the same API. MDN's shopping-list demo uses document.ariaNotify() for app-wide status updates. Use Element.ariaNotify() when the announcement should be tied to a specific control or region in the tree.
undefined. There is no promise or status object. Feature-detect the method before calling; blocked Permissions Policy usage fails silently (MDN).
MDN notes that some screen readers may only speak the most recent ariaNotify() call. Combining messages into one string is more reliable than firing several calls in a row.
Fall back to an ARIA live region (update textContent on an aria-live element). Always feature-detect: typeof document.ariaNotify === "function".
Did you know?

MDN’s shopping-list demo calls document.ariaNotify() (not Element.ariaNotify()) when items are added or removed—combining the item name and updated total in one announcement string with priority: "high".

Next: browsingTopics()

Learn the deprecated Topics API method — educational reference only.

browsingTopics() →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

6 people found this page helpful