Mat Marquis details the good-and-dangerous of a new method which we can just make a screenreader say something.
There’s a brand new
ariaNotify()method — defined by the Accessible Rich Internet Applications (WAI-ARIA) 1.3 Specification — that provides you with a means of programmatically triggering narration in a screen reader. It accepts a string as its first argument, and an optional configuration object as its second:
document.ariaNotify("Hello, World.");Code language: JavaScript (javascript)
In the past, exotic tangos with aria-live were required. The dangerous part is that, in becoming too easy, it will do more harm than good, like an alert("Click here to open the navigation."); So like Mat Says:
So just be cool about this, okay? Okay.
