[aria-live]
Example
<script>
const msg = document.createElement("div");
msg.setAttribute("aria-live", "polite");
msg.textContent = "Saved";
document.body.append(msg);
</script><div id="status" aria-live="polite"></div>
<script>
document.getElementById("status").textContent = "Saved";
</script>Screen readers watch regions that already exist, so the empty region is in the page first and only its text changes.
Common mistakes
- Injecting a new element with
aria-liveand the text at once, so nothing is announced. - Using 'assertive' for every update, so screen readers keep interrupting the user.
- Putting
aria-liveon a large container, so every small change is read aloud.
Key points
- The live region exists in the DOM before its content changes; it is not inserted together with the message.
aria-live='polite'is the default choice; 'assertive' is kept for urgent errors.- The live region wraps only the changing message, not a whole page section or form.
Interview questions
What is the difference between aria-live and role='status'?
role='status' is a live region with implicit aria-live='polite' and aria-atomic='true'. It also tells users the content is a status message.
Why is my aria-live region not announced?
Usually the region was added at the same time as its text, is hidden with display: none, or the text did not actually change. Keep it in the DOM and change its content.
Does aria-live='off' disable announcements?
Yes, updates are not announced unless the user is focused on or inside the region.