[whatwg] [WF2] Label with empty for attribute

Anne van Kesteren fora at annevankesteren.nl
Sat Jan 21 02:40:59 PST 2006


Quoting Simon Pieters <zcorpan at hotmail.com>:
> It is not defined what should happen when a label has an empty for="" 
> attribute. Consider the following example:
>
>   <label for="">foo<input></label>
>
> Is the label element part of the .labels DOM attribute for the input? 
> What should the label's .control DOM attribute return?

I think "for" should be treated analogously to "form". That would mean 
that the
<label> element is not associated with any control.

However, currently the specification states that for labels that point to
elements that are not form controls the "for" attribute must be ignored. Which
would imply that descendents can get focus...


-- 
Anne van Kesteren
<http://annevankesteren.nl/>




More information about the whatwg mailing list