WebAIM - Web Accessibility In Mind

E-mail List Archives

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


From: Sailesh Panchang
Date: Feb 23, 2016 7:43AM

>>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?

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-w3c/>;
> > > > >