WebAIM - Web Accessibility In Mind

E-mail List Archives

One question: regarding label for attribute

for

From: 김형섭
Date: Jun 6, 2016 8:55AM


Hello, I'm Hyongsop Kim in Korea and web accessibility tester.
I want to ask your opinion about label for attribute in specific condition.
The condition is that in common case, label tag and input tag is separated.
So I add for attribute in label tag and add id attribute in input tag to correspond each other.
By the way, if input tag is inside label tag, I'm a little confused.
Below is the example code.
<label><input type="checkbox">automatic login</label>
In above code, I know that input tag is inside label tag, there is no need to add id and for attribute.
But unlide NVDA screen reader, our Korean screen reader doesn't support this kind label, so if I press tab key, screen reader says only checkbox with no label.
So how can I solve this problem?
If I add for attribute in label tag and id attribute in input tag, in above code, is this okay?
Thank you for your advice.