Example 1 — Read ariaRelevant
Log the current relevant tokens from a live region.
const el = document.getElementById("clock");
console.log(el.ariaRelevant); // "all"
// HTML: aria-live="polite" aria-relevant="all" … How It Works
- Find the region.
getElementById("clock")returns the live-region node. - Read the reflection.
ariaRelevantreturns thearia-relevantstring. - Interpret
"all". Additions, removals, and text changes are all relevant. - Missing attribute. If unset, many browsers return
null; AT default is stilladditions text.

