[Javascript] accessing a <label>

Nick Wiltshire nick at customdesigns.ca
Tue Jun 5 19:15:41 CDT 2007


On Sunday 03 June 2007 18:38, Scott Reynen wrote:
> On Jun 3, 2007, at 6:10 PM, Nick Wiltshire wrote:
> > If the input is directly inside the label (as it should be)
>
> Huh?  Why?  That's not how the HTML spec examples use <label>, and a
> label containing the input it's labeling strikes me as poor semantics.

I shouldn't have used the words "should be". However, in the case specified it 
certainly simplifies locationg it within the DOM.

As far as semantics go, putting the associated control inside the label makes 
perfect sense in markup. Think of the label as more of a container than a 
sticker :)




More information about the Javascript mailing list