2013-08-19 19:21, JJ wrote:
That is correct. The interesting question is why the question was asked.
If we could see the actual problem that OP is having, it would probably
look different from the one asked, and solving it would be more useful.
That's a completely different issue, and somewhat misleading here, I'm
afraid. Technically, you can have exactly two label elements that are
associated with the same control, namely by wrapping the control inside
one label element and using another label element for it, with the
for=... and id=... attributes. But while formally correct, this would be
pointless. It could also be bad for accessibility, when using software
that can announce which label is associated with a given control.
You have misunderstood the example. The code
<!-- Simple label example with for attribute -->
<label for="Name">Click me</label>
<input type="text" id="Name" name="Name" />
<!-- or more simply -->
<label>Click me <input type="text" id="Name" name="Name" /></label>
is meant to demonstrate two alternative methods. They are not meant to
be both used for a control. Those tags, when used together, make a
document invalid in a serious way (confusing browsers), since it
violates the requirement on uniqueness of id attribute values.