diff options
Diffstat (limited to 'files/fr/web/api/htmlformelement/elements/index.html')
| -rw-r--r-- | files/fr/web/api/htmlformelement/elements/index.html | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/files/fr/web/api/htmlformelement/elements/index.html b/files/fr/web/api/htmlformelement/elements/index.html new file mode 100644 index 0000000000..14ba012b3b --- /dev/null +++ b/files/fr/web/api/htmlformelement/elements/index.html @@ -0,0 +1,31 @@ +--- +title: HTMLFormElement.elements +slug: Web/API/HTMLFormElement/elements +translation_of: Web/API/HTMLFormElement/elements +--- +<div> +<div>{{APIRef("HTML DOM")}}</div> +</div> + +<p>La propriété <code><strong>HTMLFormElement.elements</strong></code> retourne une {{domxref("HTMLFormControlsCollection")}} ({{ HTMLVersionInline(4) }} <code><a class="external" href="http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-75708506">HTMLCollection</a></code>) de tous les contrôles de formulaire contenu dans l'élément FORM, à l'exception des éléments de type <a href="/fr-FR/docs/HTML/Element/Input" title="input">input</a> dont l'attribut <code>type</code> est égal à <code>image</code>.</p> + +<p>Vous pouvez accéder à un élément particulier en utilisant soit un index soit le <code>name</code> ou l'<code>id</code> de l'élément.</p> + +<h2 id="Syntax" name="Syntax">Syntaxe</h2> + +<pre class="syntaxbox"><em>nodeList</em> = <em>HTMLFormElement</em>.elements +</pre> + +<h2 id="Example" name="Example">Exemple</h2> + +<pre class="brush:js">var inputs = document.getElementById("form1").elements; +var inputByIndex = inputs[2]; +var inputByName = inputs["login"]; +</pre> + +<h2 id="Specification" name="Specification">Spécification</h2> + +<ul> + <li><a class="external" href="http://www.w3.org/TR/html5/forms.html#dom-form-elements" title="http://www.w3.org/TR/html5/forms.html#dom-form-elements">HTML5, Section 4.10.3, The form Element</a></li> + <li><a class="external" href="http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-76728479">DOM Level 2 HTML: elements</a></li> +</ul> |
