WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: using "label for=" on things other than inputs


From: Patrick H. Lauke
Date: Feb 23, 2016 8:24AM

On 23/02/2016 14:56, Jonathan Avila wrote:
>> my interest is in whether what is defined in the spec for UA implementations is actually implemented and what effect it has on the accessible name calculation.
> So should this then logically flow to allow labeling for ARIA equivalents to buttons and input elements such as role button, role radio, and role checkbox.
> <span id="r1" role="radio" ...> ...</span><label for="r1">Milk</label>
> In the past this was not considered allowable -- but perhaps this is changing.

I believe the current reasoning is that if you're "faking" a control
using role, then you also need to fake the normal label/for relationship
using aria-label or similar. i.e. the native structural relationship is
only provided/mapped correctly by the browser/AT if you're using the
correct HTML elements (rather than forcing the roles).

Patrick H. Lauke

www.splintered.co.uk | https://github.com/patrickhlauke
http://flickr.com/photos/redux/ | http://redux.deviantart.com
twitter: @patrick_h_lauke | skype: patrick_h_lauke