status
Example
<div id="msg"></div>
<script>
// inserted with text, often missed
msg.innerHTML = '<p role="status">Saved</p>';
</script><div id="msg" role="status"></div>
<script>
msg.textContent = "Saved";
</script>The live region exists first and only its text changes, so screen readers reliably announce the update.
Common mistakes
- Adding the status element with its text at the same time, so nothing is announced.
- Using
role='status'for every update, flooding the screen reader.
Key points
- The
role='status'container is in the DOM before its text changes, not inserted together with the message. - Status messages do not move focus; the user stays where they are.
- Urgent errors use
role='alert', notrole='status'.
Interview questions
What is the difference between role='status' and role='alert'?
status is polite and waits until the user is idle; alert is assertive and interrupts. Use alert only for urgent, time-sensitive messages.
Do I need aria-live='polite' with role='status'?
No. role='status' already implies aria-live='polite' and aria-atomic='true'. Adding them again is harmless but redundant.
Does the output element have the status role?
Yes, <output> maps to the status role, so its changes are announced politely.