WebAIM - Web Accessibility In Mind

E-mail List Archives

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

for

From: Jonathan Avila
Date: Feb 23, 2016 7:56AM


> Jon, In your example:
<label for="a1"> Foreground <button id="a1">Color</button></label> With implicit labelling, there is no need for for-id, right?

Correct, although implicit labels without matching for/id are not supported by some technologies such as Dragon and perhaps Talkback on Android. So this wraps both and contains the explicit association those AT need.

> Also if "Foreground" is meant to function as a visible label like the button content, "Color", why not have the word "Foreground within button content? Visually too one may only identify "color" to be the button's name really.

This would likely be done to make sure the button widths are equal or space reasons. In some cases repeating text on each button actually makes it more difficult for people looking at the buttons. For example, say you had an add button and it corresponded with some other text in a row and you didn't want to duplicate the text.

Jonathan

Jonathan Avila
Chief Accessibility Officer
SSB BART Group
<EMAIL REMOVED>
703.637.8957 (o)
Follow us: Facebook | Twitter | LinkedIn | Blog | Newsletter

-----Original Message-----
From: WebAIM-Forum [mailto: <EMAIL REMOVED> ] On Behalf Of Sailesh Panchang
Sent: Tuesday, February 23, 2016 9:44 AM
To: WebAIM Discussion List
Subject: Re: [WebAIM] using "label for=" on things other than inputs

>>the HTML5 spec defines that any input, apart from type=hidden, can be labelled using >>the label element.
The HTML5 specs also say, "button element represents a button labeled by its contents".
So is there a need for one to use a label element to label a button really given other AT-supported methods to label a button / push button type input element are available?
Jon, In your example:
<label for="a1"> Foreground <button id="a1">Color</button></label> With implicit labelling, there is no need for for-id, right?
Also if "Foreground" is meant to function as a visible label like the button content, "Color", why not have the word "Foreground within button content? Visually too one may only identify "color" to be the button's name really.
If "color" is really non text (img of some color), then it can be assigned alt or an accessible name within the button content.
So I am trying to understand the use-case for using a label with a button or push putton type input element.
Is there any need really to change H44 or H91?
Thanks,
Sailesh


On 2/23/16, Steve Faulkner < <EMAIL REMOVED> > wrote:
> On 22 February 2016 at 18:22, Jonathan Avila
> < <EMAIL REMOVED> >
> wrote:
>
>> Steve, the API document also doesn't seem to indicate label can be used
>> for input type button, reset, submit, and image. This is the
>> traditionally understood approach. However you mention the HTML5
>> spec allows all input to be labelled yet the spec only appears to call out type
>> hidden. Is this also a bug from the Accessibility API spec or did I miss
>> something? Just wanted to confirm.
>
>
> hi Jon, the HTML5 spec defines that any input, apart from type=hidden,
> can be labelled using the label element.
>
> --
>
> Regards
>
> SteveF
> Current Standards Work @W3C
> <http://www.paciellogroup.com/blog/2015/03/current-standards-work-at-w
> 3c/> > > archives at http://webaim.org/discussion/archives
> >