Re:Why Your Form Checkboxes Need to Have Label Tags
by masklinn on Sunday June 19, 2011 @08:36AM
(#2670750)
> And I totally disagree about the semantics. Wrapping the label is much more correct semantically - it says this input and these words are related.
No, it says the input is part of the label, which is obviously nonsense. The opposite would work, but it's not legal. The @for attribute says they are related.
> I do not understand what you mean by "simpler scripting". Are you trying to make a special script action when they click the words?
Not necessarily click, but hover for instance. What if hovering over a label gave meta-information on the related field? As I noted, getting the field matching a label (and getting *whether the label has a matching field at all) is much easier via @for, it's a trivial getElementById dereference of label/@for.
No, it says the input is part of the label, which is obviously nonsense. The opposite would work, but it's not legal. The @for attribute says they are related.
> I do not understand what you mean by "simpler scripting". Are you trying to make a special script action when they click the words?
Not necessarily click, but hover for instance. What if hovering over a label gave meta-information on the related field? As I noted, getting the field matching a label (and getting *whether the label has a matching field at all) is much easier via @for, it's a trivial getElementById dereference of label/@for.