title="">form</var>.elements</a></code> and <code
title=dom-fieldset-elements><a href="#elements4"><var
title="">fieldset</var>.elements</a></code> APIs.
<dt><dfn id=labelable title=category-label>Labelable</dfn>
<dd>Denotes elements that can be associated with <code><a
href="#label">label</a></code> elements.
</dl>
<p>In addition, some <a href="#submittable"
<dt>Content model:
<dd><a href="#phrasing0">Phrasing content</a>.
<dd>If the element has a <code title=attr-label-for><a
href="#for">for</a></code> attribute: <a href="#phrasing0">Phrasing
content</a>, but with no descendant <a href="#labelable"
title=category-label>labelable form-associated elements</a> or <code><a
href="#label">label</a></code> elements.
<dd>Otherwise: <a href="#phrasing0">Phrasing content</a>, but with at most
one descendant <a href="#labelable" title=category-label>labelable
form-associated element</a>, and with no descendant <code><a
href="#label">label</a></code> elements.
<dt>Element-specific attributes:
<dd><code title=attr-fae-form><a href="#form0">form</a></code>
<dd><code title=attr-label-for>for</code>
<dd><code title=attr-label-for><a href="# for">for</a> </code>
<dt>DOM interface:
<dd>
<pre
class=idl>interface <dfn id=htmllabelelement>HTMLLabelElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
readonly attribute <a href="#htmlformelement">HTMLFormElement</a> <a href="#form1" title=dom-fae-form>form</a>;
attribute DOMString <span title=dom-label-htmlFor>htmlFor</span >;
readonly attribute <a href="#htmlelement">HTMLElement</a> <span title=dom-label-control>control</span >;
attribute DOMString <a href="#htmlfor" title=dom-label-htmlFor>htmlFor</a >;
readonly attribute <a href="#htmlelement">HTMLElement</a> <a href="#control" title=dom-label-control>control</a >;
};</pre>
</dl>
<p class=big-issue>...</p>
<!--XXX
what does <label> _mean_? how about an empty one, one which contains
more than one control, no controls?
-->
<p>The <code><a href="#label">label</a></code> represents a caption in a
user interface. The caption can be associated with a specific form
control, known as the <code><a href="#label">label</a></code> element's
<dfn id=labeled>labeled control</dfn>.
<p>Unless otherwise specified by the following rules, a <code><a
href="#label">label</a></code> element has no <a href="#labeled">labeled
control</a>.
<p>The <dfn id=for title=attr-label-for><code>for</code></dfn> attribute
may be specified to indicate a form control with which the caption is to
be associated. If the attribute is specified, the attribute's value must
be the ID of a <a href="#labelable" title=category-label>labelable
form-associated element</a> in the same <code>Document</code> as the
<code><a href="#label">label</a></code> element. If the attribute is
specified and there is an element in the <code>Document</code> whose ID is
equal to the value of the <code title=attr-label-for><a
href="#for">for</a></code> attribute, and the first such element is a <a
href="#labelable" title=category-label>labelable form-associated
element</a>, then that element is the <code><a
href="#label">label</a></code> element's <a href="#labeled">labeled
control</a>.
<p>If the <code title=attr-label-for><a href="#for">for</a></code>
attribute is not specified, but the <code><a
href="#label">label</a></code> element has a <span>labelable
form-associated element</span> descendant, then the first such descendant
in <a href="#tree-order">tree order</a> is the <code><a
href="#label">label</a></code> element's <a href="#labeled">labeled
control</a>.
<p>The <code title=attr-fae-form><a href="#form0">form</a></code> attribute
is used to explicitly associate the <code><a
href="#label">label</a></code> element with its <a href="#form-owner">form
owner</a>. The <code title=attr-fe-name><a href="#name11">name</a></code>
attribute represents the element's name.
<p>The <dfn id=htmlfor title=dom-label-htmlFor><code>htmlFor</code></dfn>
DOM attribute must <a href="#reflect">reflect</a> the <code
title=attr-label-for><a href="#for">for</a></code> content attribute.
<p>The <dfn id=control title=dom-label-control><code>control</code></dfn>
DOM attribute must return the <code><a href="#label">label</a></code>
element's <a href="#labeled">labeled control</a>, if any, or null if there
isn't one.
<hr>
<p><span title="labelable form-associated element">Labelable
form-associated elements</span> have a <code>NodeList</code> object
associated with them that represents the list of <code><a
href="#label">label</a></code> elements, in <a href="#tree-order">tree
order</a>, whose <a href="#labeled">labeled control</a> is the element in
question. The <dfn id=labels
title=dom-lfe-labels><code>labels</code></dfn> DOM attribute of <span
title="labelable form-associated element">labelable form-associated
elements</span>, on getting, must return that <code>NodeList</code>
object.
<h4 id=the-input><span class=secno>4.9.4 </span>The <dfn
id=input0><code>input</code></dfn> element</h4>
<dd><a href="#interactive1">Interactive content</a>.
<dd><a href="#listed" title=category-listed>Listed</a>, <a
href="#labelable" title=category-label>labelable</a>, <a
href="#submittable" title=category-submit>submittable</a>, and <a
href="#resettable" title=category-reset>resettable</a> <a
href="#form-associated">form-associated element</a>.
attribute float <span title=dom-input-valueAsNumber>valueAsNumber</span>;
readonly attribute <a href="#htmloptionelement">HTMLOptionElement</a> <span title=dom-input-selectedOption>selectedOption</span>;
readonly attribute <a href="#htmlcollection0">HTMLCollection</a> <span title=dom-input -labels>labels</span >;
readonly attribute <a href="#htmlcollection0">HTMLCollection</a> <a href="#labels" title=dom-lfe -labels>labels</a >;
void <span title=dom-input-stepUp>stepUp</span>(in int n);
void <span title=dom-input-stepDown>stepDown</span>(in int n);
<dd><a href="#interactive1">Interactive content</a>.
<dd><a href="#listed" title=category-listed>Listed</a> and <a
<dd><a href="#listed" title=category-listed>Listed</a>, <a
href="#labelable" title=category-label>labelable</a>, and <a
href="#submittable" title=category-submit>submittable</a> <a
href="#form-associated">form-associated element</a>.
attribute DOMString <span title=dom-button-type>type</span>;
attribute DOMString <span title=dom-button-value>value</span>;
readonly attribute <a href="#htmlcollection0">HTMLCollection</a> <span title=dom-button -labels>labels</span >;
readonly attribute <a href="#htmlcollection0">HTMLCollection</a> <a href="#labels" title=dom-lfe -labels>labels</a >;
readonly attribute boolean <a href="#willvalidate" title=dom-cva-willValidate>willValidate</a>;
readonly attribute <span>ValidityState</span> <a href="#validity" title=dom-cva-validity>validity</a>;
<dd><a href="#interactive1">Interactive content</a>.
<dd><a href="#listed" title=category-listed>Listed</a>, <a
href="#labelable" title=category-label>labelable</a>, <a
href="#submittable" title=category-submit>submittable</a>, and <a
href="#resettable" title=category-reset>resettable</a> <a
href="#form-associated">form-associated element</a>.
attribute long <span title=dom-select-selectedIndex>selectedIndex</span>;
attribute DOMString <span title=dom-select-value>value</span>;
readonly attribute <a href="#htmlcollection0">HTMLCollection</a> <span title=dom-select -labels>labels</span >;
readonly attribute <a href="#htmlcollection0">HTMLCollection</a> <a href="#labels" title=dom-lfe -labels>labels</a >;
void <span title=dom-select-add>add</span>(in <a href="#htmlelement">HTMLElement</a> element, in <a href="#htmlelement">HTMLElement</a> before);
void <span title=dom-select-remove>remove</span>(in long index);
<dd><a href="#interactive1">Interactive content</a>.
<dd><a href="#listed" title=category-listed>Listed</a>, <a
href="#labelable" title=category-label>labelable</a>, <a
href="#submittable" title=category-submit>submittable</a>, and <a
href="#resettable" title=category-reset>resettable</a> <a
href="#form-associated">form-associated element</a>.
attribute DOMString <span title=dom-textarea-defaultValue>defaultValue</span>;
attribute DOMString <span title=dom-textarea-value>value</span>;
readonly attribute <a href="#htmlcollection0">HTMLCollection</a> <span title=dom-textarea -labels>labels</span >;
readonly attribute <a href="#htmlcollection0">HTMLCollection</a> <a href="#labels" title=dom-lfe -labels>labels</a >;
readonly attribute boolean <a href="#willvalidate" title=dom-cva-willValidate>willValidate</a>;
readonly attribute <span>ValidityState</span> <a href="#validity" title=dom-cva-validity>validity</a>;