[aria-live]

Term side of the Card.
Topic: Global ARIA Attributes
Unit title: [aria-live]
Categories: Attribute
Explanation side of the Card

Explanation: The attribute that indicates how updates to an element should be announced by assistive technologies. It helps users stay informed about changes to dynamic content, such as notifications or live updates.

Example

Wronghtml
<script>
  const msg = document.createElement("div");
  msg.setAttribute("aria-live", "polite");
  msg.textContent = "Saved";
  document.body.append(msg);
</script>
Righthtml
<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-live and the text at once, so nothing is announced.
  • Using 'assertive' for every update, so screen readers keep interrupting the user.
  • Putting aria-live on 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.

Analytics cookiesWe'd like to use analytics cookies to see which pages are useful. They're set only if you accept. Privacy Policy