WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Labelling a "fill in the blank" form field

for

From: glen walker
Date: Apr 25, 2018 4:58PM


I could have taken an extra 2 min to test it before posting my question.
The accessible name generation is pretty clear on the precedence.

https://www.w3.org/TR/accname-1.1/#step2

2c is before 2d.
2c gets the accessible name from the aria-label attribute
2d gets the accessible name from the label element

So the aria-label should win (and it does when I try NVDA on firefox and
JAWS on Internet Explorer)

So, Birkir, did I read your suggestion incorrectly? Did you say to use
both a <label> element and the aria-label attribute?

Glen

On Wed, Apr 25, 2018 at 4:50 PM, glen walker < <EMAIL REMOVED> > wrote:

> Birkir, wouldn't that be conflicting information? You'd have a <label>
> for the <input> field *and* have an aria-label for the <input> field?
> Which one should win?
>
>
> On Wed, Apr 25, 2018 at 2:19 PM, Birkir R. Gunnarsson <
> <EMAIL REMOVED> > wrote:
>
>> Tim makes good suggestions.
>> I'd try wrapping the whole question in a <label> element, then add
>> aria-label="answer" to the <input> field.
>> See how that is interpreted by a screen reader.
>>
>>