WebAIM - Web Accessibility In Mind

E-mail List Archives

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


From: Patrick H. Lauke
Date: Feb 20, 2016 5:47AM

On 20/02/2016 12:42, Detlev Fischer wrote:
> All this doesn't quite answer my original question whether the use of
> label on elements other than those Steve listed could be confusing
> and should be discouraged. I take it nobody would see a failure of
> 1.3.1 for using 'label for=' on read-only text,

If it's a scenario like something in a form that the user is not
currently allowed to actually edit, I'd actually suggest turning that
text into a readonly input (and then yes, having the label associated
with that input. Otherwise, I'd say it's a mild failure as there's no
relationship defined between the label and what is static text (as that
relationship is not exposed in the accessibility tree, even if there
for="..." points to an id for the container of the text.

> disabled input,

It may be disabled, but the relationship to its label is still needed
(if the user navigated to this input with the reading keys, even though
they can't actively TAB/SHIFT+TAB into it)

> or a
> button that already has an accessible name via value - correct?

If <label for="..."> on a button is legit per spec (which seems to be
what Steve is saying), then that should be legitimate. Whether it's
appropriate and/or supported by actual browser/AT combinations is
another matter...


> Sent from phone
>> On 20 Feb 2016, at 09:37, Steve Faulkner < <EMAIL REMOVED> >
>> wrote:
>> On 20 February 2016 at 01:42, Jonathan Avila
>> < <EMAIL REMOVED> > wrote:
>>> HTML Accessibility API Mappings 1.0<
>>> https://www.w3.org/TR/html-aam-1.0/#button-element> also
>>> indicates the following which does not seem to include the label
>>> element:
>> Yes you are correct that this is was the API spec currently says,
>> that is my fault.
>> I have filed an issue https://github.com/w3c/aria/issues/259
>> --
>> Regards
>> SteveF Current Standards Work @W3C
>> <http://www.paciellogroup.com/blog/2015/03/current-standards-work-at-w3c/>;
>> >> archives at http://webaim.org/discussion/archives >> messages to <EMAIL REMOVED>
> > subscription, visit http://list.webaim.org/ List archives at
> http://webaim.org/discussion/archives > <EMAIL REMOVED>

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