Alerts are dynamic content that is injected into the page when it changes and a person using a screenreader needs to know that some state of the application has changed.
- Use alerts sparingly.
- If an alert is present on page load, it won’t be read automatically
- If an element is present on page load, it is not technically an alert
- The alert will be read by the screen reader when it becomes visible / appears in the DOM
- Screenreaders do not implement alerts uniformly and must be tested
- JAWS and VoiceOver are more generous than NVDA in triggering alert messages
- Just because an alert pattern works in one screenreader doesn’t mean it will work in all three
- Inner text describes alert when it appears on screen
role="alert"for elements injected into the page
- Focus does move to the element when the alert appears