[Javascript] accessing a <label>

Nick Fitzsimons nick at nickfitz.co.uk
Tue Jun 5 07:18:27 CDT 2007


On 4 Jun 2007, at 01:38:43, 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.

The HTML spec's third example does precisely that:

<http://www.w3.org/TR/html4/interact/forms.html#edef-LABEL>

as a demonstration of implicit association of a label with a control.

I can't see how this technique can be said to have poor semantics.  
The semantic significance of a label is that it describes the  
expected content of an associated control, and this is just an  
implicit way of forming that association.

Regards,

Nick.
-- 
Nick Fitzsimons
http://www.nickfitz.co.uk/






More information about the Javascript mailing list