W3C home > Mailing lists > Public > www-validator@w3.org > October 2013

The label element may contain at most one input, button, select, textarea, or keygen descendant.

From: Felix E. Klee <felix.klee@inka.de>
Date: Tue, 1 Oct 2013 09:36:41 +0200
Message-ID: <CA+m_8J0iBQF-6fLZhm042X_R-tnVFA+=mQ8acZy9SBHVXRai_A@mail.gmail.com>
To: www-validator@w3.org
That's what the validator says for:

    <!DOCTYPE html>
    <html>
      <head>
    <meta charset="utf-8" />
    <title>Test</title>
      </head>
      <body>
        <label>
          <input type="radio" />
          <input type="text" />
        </label>
      </body>
    </html>

However, the HTML5 W3C Candidate Recommendation 6 August 2013
[suggests][1] that multiple input ("labelable") elements are OK:

> If the for attribute is not specified, but the label element has a
> labelable element descendant, then the first such descendant in tree
> order is the label element's labeled control.

Who is right?

[1]: http://www.w3.org/TR/html5/forms.html#the-label-element
Received on Tuesday, 1 October 2013 07:37:39 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 1 March 2016 14:18:09 UTC