diff options
Diffstat (limited to 'files/it/web/api/document/firstchild')
| -rw-r--r-- | files/it/web/api/document/firstchild/index.html | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/files/it/web/api/document/firstchild/index.html b/files/it/web/api/document/firstchild/index.html new file mode 100644 index 0000000000..ed5a34a883 --- /dev/null +++ b/files/it/web/api/document/firstchild/index.html @@ -0,0 +1,40 @@ +--- +title: document.firstChild +slug: Web/API/Document/firstChild +translation_of: Web/API/Node/firstChild +--- +<div>{{APIRef("DOM")}}</div> + +<p><code>document.firstChild</code> restituisce il primo nodo figlio del documento.</p> + +<h3 id="Sintassi" name="Sintassi">Sintassi</h3> + +<pre class="eval"><i>child = document.firstChild</i> +</pre> + +<h3 id="Parametri" name="Parametri">Parametri</h3> + +<ul> + <li><code>figlio</code> รจ un nodo di tipo <a href="it/DOM/element">element</a>.</li> +</ul> + +<h3 id="Esempio" name="Esempio">Esempio</h3> + +<pre>function primoFiglio() { + f = document.firstChild; + alert(f.tagName); +} +// restituisce [object DocumentType] se il documento ha una DTD +// altrimenti restituisce "HTML" + +// Per un documento HTML che ha una DTD +// document.firstChild +// restituisce [object DocumentType] + +</pre> + +<h3 id="Specifiche" name="Specifiche">Specifiche</h3> + +<p><a class="external" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-169727388">DOM Level 2 Core: firstChild</a></p> + +<p>{{ languages( { "pl": "pl/DOM/document.firstChild" } ) }}</p> |
