Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 666517 of HTMLFormControlsCollection

  • Revision slug: Web/API/HTMLFormControlsCollection
  • Revision title: HTMLFormControlsCollection
  • Revision id: 666517
  • Created:
  • Creator: teoli
  • Is current revision? No
  • Comment

Revision Content

{{ APIRef("HTMLFormControlsCollection", "HTMLCollection") }}

The HTMLFormControlsCollection interface represents a collection of HTML form control elements. It provides one additional method besides the properties and methods inherited from {{domxref("HTMLCollection")}}.

This interface is used by the {{domxref("HTMLFormElement")}} interface's elements property, and the {{domxref("HTMLFieldSetElement")}} interface's elements property.

Properties

This interface inherits the properties of its parent, {{domxref("HTMLCollection")}}.

Methods

This interface inherits the methos of its parent, {{domxref("HTMLCollection")}}.

{{domxref("HTMLFormControlsCollection.namedItem()")}}
Returns the {{domxref("RadioNodeList")}} or the {{domxref("Element")}} in the collection whose name or id match the specified name, or null if no nodes match. Note that this version of namedItem() hide the one inherited from {{domxref("HTMLCollection")}}. Like that one, in Javascript, using the array bracket syntax with a {{jsxref("String")}}, like collection["value"] is equivalent to collection.namedItem("value").

Specifications

Specification Status Comment
{{SpecName('HTML WHATWG', "infrastructure.html#htmlformcontrolscollection", "HTMLFormControlsCollection")}} {{Spec2('HTML WHATWG')}} No change since the last snapshot, {{SpecName('HTML5 W3C')}}.
{{SpecName('HTML5 W3C', "infrastructure.html#htmlformcontrolscollection", "HTMLFormControlsCollection")}} {{Spec2('HTML5 W3C')}} In this snapshot of {{SpecName("HTML WHATWG")}}, the HTMLFormControlsCollections is defined for the first time.

Browser compatibility

{{CompatibilityTable}}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support {{CompatVersionUnknown}} {{CompatGeckoDesktop(27)}} [1] {{CompatNo}} {{CompatVersionUnknown}} {{CompatUnknown}}
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support {{CompatVersionUnknown}} {{CompatGeckoMobile(27)}} [1] {{CompatNo}} {{CompatVersionUnknown}} {{CompatUnknown}}

[1] Until Firefox 32 included, the eventual {{domxref("RadioNodeList")}} returned by namedItem was a {{domxref("NodeList")}}.

See also

  • {{domxref("HTMLCollection")}}, {{domxref("RadioNodeList")}}, {{domxref("HTMLOptionsCollection")}}

Revision Source

<p>{{ APIRef("HTMLFormControlsCollection", "HTMLCollection") }}</p>
<p>The <strong><code>HTMLFormControlsCollection</code></strong> interface represents a <em>collection</em> of HTML <em>form control elements</em>. It provides one additional method besides the properties and methods inherited from {{domxref("HTMLCollection")}}.</p>
<p>This interface is used by the {{domxref("HTMLFormElement")}} interface's <code>elements</code> property, and the {{domxref("HTMLFieldSetElement")}} interface's <code>elements</code> property.</p>
<h2 id="Properties">Properties</h2>
<p><em>This interface inherits the properties of its parent, {{domxref("HTMLCollection")}}.</em></p>
<h2 id="Methods">Methods</h2>
<p><em>This interface inherits the methos of its parent, {{domxref("HTMLCollection")}}.</em></p>
<dl>
 <dt>
  {{domxref("HTMLFormControlsCollection.namedItem()")}}</dt>
 <dd>
  Returns the {{domxref("RadioNodeList")}} or the {{domxref("Element")}} in the collection whose <code>name</code> or <code>id</code> match the specified name, or <code>null</code> if no nodes match. Note that this version of <code>namedItem()</code> hide the one inherited from {{domxref("HTMLCollection")}}. Like that one, in Javascript, using the array bracket syntax with a {{jsxref("String")}}, like <code><em>collection</em>["value"]</code> is equivalent to <code><em>collection</em>.namedItem("value")</code>.</dd>
</dl>
<h2 id="Specifications">Specifications</h2>
<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
  <tr>
   <td>{{SpecName('HTML WHATWG', "infrastructure.html#htmlformcontrolscollection", "HTMLFormControlsCollection")}}</td>
   <td>{{Spec2('HTML WHATWG')}}</td>
   <td>No change since the last snapshot, {{SpecName('HTML5 W3C')}}.</td>
  </tr>
  <tr>
   <td>{{SpecName('HTML5 W3C', "infrastructure.html#htmlformcontrolscollection", "HTMLFormControlsCollection")}}</td>
   <td>{{Spec2('HTML5 W3C')}}</td>
   <td>In this snapshot of {{SpecName("HTML WHATWG")}}, the <code>HTMLFormControlsCollections</code> is defined for the first time.</td>
  </tr>
 </tbody>
</table>
<h2 id="Browser_compatibility">Browser compatibility</h2>
<p>{{CompatibilityTable}}</p>
<div id="compat-desktop">
 <table class="compat-table">
  <tbody>
   <tr>
    <th>Feature</th>
    <th>Chrome</th>
    <th>Firefox (Gecko)</th>
    <th>Internet Explorer</th>
    <th>Opera</th>
    <th>Safari (WebKit)</th>
   </tr>
   <tr>
    <td>Basic support</td>
    <td>{{CompatVersionUnknown}}</td>
    <td>{{CompatGeckoDesktop(27)}} [1]</td>
    <td>{{CompatNo}}</td>
    <td>{{CompatVersionUnknown}}</td>
    <td>{{CompatUnknown}}</td>
   </tr>
  </tbody>
 </table>
</div>
<div id="compat-mobile">
 <table class="compat-table">
  <tbody>
   <tr>
    <th>Feature</th>
    <th>Android</th>
    <th>Firefox Mobile (Gecko)</th>
    <th>IE Phone</th>
    <th>Opera Mobile</th>
    <th>Safari Mobile</th>
   </tr>
   <tr>
    <td>Basic support</td>
    <td>{{CompatVersionUnknown}}</td>
    <td>{{CompatGeckoMobile(27)}} [1]</td>
    <td>{{CompatNo}}</td>
    <td>{{CompatVersionUnknown}}</td>
    <td>{{CompatUnknown}}</td>
   </tr>
  </tbody>
 </table>
</div>
<p>[1] Until Firefox 32 included, the eventual {{domxref("RadioNodeList")}} returned by <code>namedItem</code> was a {{domxref("NodeList")}}.</p>
<h2 id="See_also">See also</h2>
<ul>
 <li>{{domxref("HTMLCollection")}}, {{domxref("RadioNodeList")}}, {{domxref("HTMLOptionsCollection")}}</li>
</ul>
Revert to this revision