Accessibility: aria-label is not getting announced in span by NVDA

Viewed 29

I want to have aria-label in span get announced. I did a lot search, found a solution that add role="img". However, in this way, the "image" word will also be announced. I am wondering if there is a hack way to only announce the aria-label or aria-description for span?

For example, I want "123" to be announced:

<span aria-description="123">456</span>

1 Answers

The aria-label is sometimes ignored by some assistive technology if the element you put it on doesn't have any semantic meaning. A <span> doesn't have semantic meaning. If you add a role that is appropriate for your description, then it should be read correctly.

Related