Join our Agency Partner Program: Elevate your digital agency by offering web accessibility services with RAMPLearn More
Overwhelmed by WCAG success criteria?
Accessible Web RAMP is the easiest way to discover, understand, and resolve web accessibility issues
that matter most to your users.
How do I code a polite alert?
Question
What is the best way to code a polite alert?
Answer
A polite alert is a message which is presented by the screen reader after it has completed all queued announcements. Typically these should be used when you want to present a message to assistive technology without a user having to navigate to that message, but when the message is not important enough to warrant interrupting the screen reader's announcement of other content.
To create a polite alert, place an empty <div> on the web page and give that <div> an attribute of aria-live="polite". Then, when you wish to present the status message, inject the text into that <div>.