WebAIM - Web Accessibility In Mind

E-mail List Archives

RE: label element containing input element

for

From: Tim Harshbarger
Date: Nov 6, 2003 6:28AM


Dey,

I came across this potential contradiction as well. Basically, I think it
might be a difference between specifications and reality.

I believe in both the HTML 4.01 and XHTML 1.0 specs, it states that you can
place the input element inside the label element. However, whenever I have
tested this on the browsers I use with the screen readers I use, it does not
work. Of course, it could also be that there are other assistive
technologies or browsers which support this -- and I just do not know which
ones they are.

I expect that someone will mention that this has to do with poor browser
implementation of the specs -- and it would be great if user agents did
fully implment what is in the specs. However, from a practical "I've gotta
make it work today" aspect, I just rely on using the label element along
with the for and id attributes to establish explicit relationships between
labels and forms controls -- that is when it is not a group label or I find
myself in one of those situations where the label element just does not
quite get the job done.

Tim

>