WebAIM - Web Accessibility In Mind

E-mail List Archives

Label for and input id--basic question revisited.

for

From: Nancy Johnson
Date: Jan 24, 2014 8:28AM


2 Questions :

If the the label and input abut each other in the layout, is 'label
for' 'id' necessary?
<label class="someclass" label for="name">name</label><input
type="text" id="name">

If the label wraps around the input is 'label for' 'id' necessary?
<label class="someclass">name<input type="text"></label>

My understanding was the labeling came at a time when we all used
layout tables and the label was in one column and input in another
column?

Thanks

Nancy