diff options
Diffstat (limited to 'files/fr/orphaned/web/api/parentnode/firstelementchild/index.html')
| -rw-r--r-- | files/fr/orphaned/web/api/parentnode/firstelementchild/index.html | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/files/fr/orphaned/web/api/parentnode/firstelementchild/index.html b/files/fr/orphaned/web/api/parentnode/firstelementchild/index.html new file mode 100644 index 0000000000..ae70e6aa66 --- /dev/null +++ b/files/fr/orphaned/web/api/parentnode/firstelementchild/index.html @@ -0,0 +1,46 @@ +--- +title: Element.firstElementChild +slug: orphaned/Web/API/ParentNode/firstElementChild +tags: + - Parcours arborescence +translation_of: Web/API/ParentNode/firstElementChild +original_slug: Web/API/ParentNode/firstElementChild +--- +<p>{{ gecko_minversion_header("1.9.1") }}</p> + +<p>{{ ApiRef() }}</p> + +<h3 id="Summary" name="Summary">Résumé</h3> + +<p><strong><span style="font-family: Verdana,Tahoma,sans-serif;">firstElementChild</span></strong> renvoie le premier élément enfant d'un élément ou <code>null</code> s'il n'y a pas de descendants.</p> + +<h3 id="Syntax_and_values" name="Syntax_and_values">Syntaxe and valeurs</h3> + +<pre class="eval">var <em>N</em><em>oeudEnfant</em> = ReferenceElementNoeud.firstElementChild; </pre> + +<p><var>NoeudEnfant</var> est une référence vers le premier élément enfant de l'élément noeud , ou <code>null</code> s'il n'y en a pas.</p> + +<p>Cet attribut est en lecture seule.</p> + +<h3 id="Example" name="Example">Exemple</h3> + +<pre><p id="para-01"> + <span>Premier span</span> +</p> + +<script type="text/javascript"> + var p01 = document.getElementById('para-01'); + alert(p01.firstElementChild.nodeName) +</script></pre> + +<p>Dans cet exemple la fonction alert affiche "SPAN", qui est le nom du premier nœud enfant de l'élément paragraphe.</p> + +<h3 id="Voir_aussi">Voir aussi</h3> + +<ul> + <li><a class="internal" href="/en/DOM/Element.childElementCount" title="En/DOM/Element.childElementCount"><code>childElementCount</code></a></li> + <li><a class="internal" href="/en/DOM/Element.children" title="En/DOM/Element.children"><code>children</code></a></li> + <li><a class="internal" href="/en/DOM/Element.lastElementChild" title="En/DOM/Element.lastElementChild"><code>lastElementChild</code></a></li> + <li><a class="internal" href="/en/DOM/Element.nextElementSibling" title="En/DOM/Element.nextElementSibling"><code>nextElementSibling</code></a></li> + <li><a class="internal" href="/en/DOM/Element.previousElementSibling" title="En/DOM/Element.previousElementSibling"><code>previousElementSibling</code></a></li> +</ul> |
