[aria-atomic]
Example
<p aria-live="polite">
Cart: <span id="count">2</span> items
</p><p aria-live="polite" aria-atomic="true">
Cart: <span id="count">2</span> items
</p>With aria-atomic='true', changing the count reads the full sentence instead of just the new number.
Common mistakes
- Only the changed number is read, like '3' instead of 'Item 3 of 10', because
aria-atomicis missing.
Key points
aria-atomicis set on the live region (or an ancestor inside it), not on unrelated elements.- Regions where a partial update loses meaning, like 'Item 3 of 10', use
aria-atomic='true'.
Interview questions
What is the default value of aria-atomic?
The default is 'false', so only the changed nodes are announced. The status and alert roles imply 'true'.
Does aria-atomic work without aria-live?
It has effect only inside a live region, which can come from aria-live or from a live role like status, alert or log.