WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Can aria-labelledby refer to a label?

for

From: Patrick H. Lauke
Date: Jul 2, 2013 1:40PM


On 02/07/2013 20:34, Birkir R. Gunnarsson wrote:

> Now, what if we assigned the label for each radio button its own id.
> <label id="foo" for "bar">Some text</label>
> <input type="radio" id="bar" value="something">
> .. and associate the same label to the text input field that has to be
> used if user selects this button
> <input type="text" value="" size="20" aria-labelledby="foo">
>
> Just curious if anyone has tried or used this approach, or, if for
> some reason, it is safer to create a label separately for the input
> text field.
> (I know aria-labelledby is not yet universally supported across A.T.s
> which is a problem. I also have never assigned a unique ID to a label,
> but my Googling indicates that is not a problem).

Beyond support in older ATs, there's no reason why this shouldn't be
supported. In fact, I seem to remember testing something very similar a
few weeks ago using VoiceOver/iOS and it worked like a charm.

P
--
Patrick H. Lauke