Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>No, it's not correct (since, as you note, a <code>label</code> is associated with exactly <strong><em>one</em></strong> form input).</p> <p>To label a group of inputs that belong together, use a <code>&lt;fieldset&gt;</code> and a <code>&lt;legend&gt;</code>:</p> <p><div class="snippet" data-lang="js" data-hide="false"> <div class="snippet-code"> <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;fieldset&gt; &lt;legend&gt;Range&lt;/legend&gt; &lt;label for="min"&gt;Min&lt;/label&gt; &lt;input id="min" name="min" /&gt; &lt;label for="max"&gt;Max&lt;/label&gt; &lt;input id="max" name="max" /&gt; &lt;/fieldset&gt;</code></pre> </div> </div> </p> <p>References:</p> <ul> <li><a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input" rel="noreferrer"><code>&lt;input /&gt;</code></a><sup><a href="http://www.w3.org/TR/html5/forms.html#the-input-element" rel="noreferrer">HTML 5 spec</a>, <a href="https://html.spec.whatwg.org/multipage/forms.html#the-input-element" rel="noreferrer">WHATWG definition</a></sup>.</li> <li><a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/fieldset" rel="noreferrer"><code>&lt;fieldset&gt;</code></a><sup><a href="http://www.w3.org/TR/html5/forms.html#the-fieldset-element" rel="noreferrer">HTML 5 spec</a>, <a href="https://html.spec.whatwg.org/multipage/forms.html#the-fieldset-element" rel="noreferrer">WHATWG definition</a></sup>.</li> <li><a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label" rel="noreferrer"><code>&lt;label&gt;</code></a><sup><a href="http://www.w3.org/TR/html5/forms.html#the-label-element" rel="noreferrer">HTML 5 spec</a>, <a href="https://html.spec.whatwg.org/multipage/forms.html#the-label-element" rel="noreferrer">WHATWG definition</a></sup>.</li> <li><a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/legend" rel="noreferrer"><code>&lt;legend&gt;</code></a><sup><a href="http://www.w3.org/TR/html5/forms.html#the-legend-element" rel="noreferrer">HTML 5 spec</a>, <a href="https://html.spec.whatwg.org/multipage/forms.html#the-legend-element" rel="noreferrer">WHATWG definition</a></sup>.</li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload