Question

Is it possible to use the aria-describedby attribute on a div? I've seen that implemented on buttons and input elements, but not on span or div. Any idea?

I tried it and used ChromeVox and MacOS Voice Over, but I got no response or description.

Best Regards!

Sy

Was it helpful?

Solution 2

I don't see why not, it should work with div's too http://www.w3.org/TR/wai-aria/states_and_properties#aria-describedby

OTHER TIPS

Aria-describedby is designed to work with interactive elements like links, buttons, and form fields. It usually doesn't work with static elements like divs and spans unless you add a role to it.

However, in my testing, its support among browsers and screen readers is inconsistent at best and nonexistent in some, especially when it comes to form fields. With forms, I avoid it altogether and use other solutions like aria-labelledby (which has much stronger support).

Webaim, who I greatly respect, provides more info on advanced form controls and labeling: https://webaim.org/techniques/forms/advanced

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top