I am looking for a way to have a text updated by an action without displaying it on the webpage, but still have it announced by screen readers. I tried using display: none
and visibility: hidden
, however, these properties seem to not be accessible by screen reader software. I discovered a method where I can position the element off-screen with a negative 999999 value to achieve this, but I find this solution less than ideal. Is there a more elegant approach to accomplishing this?
<span class="aria-invisible" aria-live="polite">5 selections have been made.</span>
.aria-invisible {
display: none; //either of these two attributes
visibility: hidden;
}