diff options
| author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:42:17 -0500 |
|---|---|---|
| committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:42:17 -0500 |
| commit | da78a9e329e272dedb2400b79a3bdeebff387d47 (patch) | |
| tree | e6ef8aa7c43556f55ddfe031a01cf0a8fa271bfe /files/it/web/api/document/head | |
| parent | 1109132f09d75da9a28b649c7677bb6ce07c40c0 (diff) | |
| download | translated-content-da78a9e329e272dedb2400b79a3bdeebff387d47.tar.gz translated-content-da78a9e329e272dedb2400b79a3bdeebff387d47.tar.bz2 translated-content-da78a9e329e272dedb2400b79a3bdeebff387d47.zip | |
initial commit
Diffstat (limited to 'files/it/web/api/document/head')
| -rw-r--r-- | files/it/web/api/document/head/index.html | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/files/it/web/api/document/head/index.html b/files/it/web/api/document/head/index.html new file mode 100644 index 0000000000..941a533431 --- /dev/null +++ b/files/it/web/api/document/head/index.html @@ -0,0 +1,84 @@ +--- +title: Document.head +slug: Web/API/Document/head +tags: + - API + - Document + - HTML DOM + - Proprietà + - Referenza +translation_of: Web/API/Document/head +--- +<div>{{APIRef("DOM")}}</div> + +<p><span class="seoSummary">La proprietà <code><strong>head</strong></code> di sola lettura dell'interfaccia {{domxref("Document")}} restituisce l'elemento {{HTMLElement("head")}} del documento corrente.</span></p> + +<h2 id="Sintassi">Sintassi</h2> + +<pre class="syntaxbox">var <var>objRef</var> = document.head; +</pre> + +<h3 id="Valore">Valore</h3> + +<p>Un {{domxref("HTMLHeadElement")}}.</p> + +<h2 id="Esempio">Esempio</h2> + +<pre class="brush: html"><!doctype html> +<head id="my-document-head"> + <title>Esempio: usare document.head</title> +</head> + +<script> + var theHead = document.head; + + console.log(theHead.id); // "my-document-head"; + + console.log( theHead === document.querySelector("head") ); // true +</script> +</pre> + +<h2 id="Appunti">Appunti</h2> + +<p><code>document.head</code> è di sola lettura. Cercare di assegnare un valore a questa proprietà fallirà silenziosamente o, in <a href="/en-US/docs/Web/JavaScript/Reference/Strict_mode">Strict Mode</a>, genera un {{jsxref("TypeError")}} .</p> + +<h2 id="Specifiche">Specifiche</h2> + +<table class="spectable standard-table"> + <thead> + <tr> + <th scope="col">Specifica</th> + <th scope="col">Stato</th> + <th scope="col">Commento</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{SpecName('HTML5.1','dom.html#dom-document-head','Document.head')}}</td> + <td>{{Spec2('HTML5.1')}}</td> + <td> </td> + </tr> + <tr> + <td>{{SpecName('HTML5 W3C','dom.html#dom-document-head','Document.head')}}</td> + <td>{{Spec2('HTML5 W3C')}}</td> + <td> </td> + </tr> + <tr> + <td>{{SpecName('HTML WHATWG','dom.html#dom-document-head','Document.head')}}</td> + <td>{{Spec2('HTML WHATWG')}}</td> + <td>Definizione iniziale.</td> + </tr> + </tbody> +</table> + +<h2 id="Compatibilità_con_i_browser">Compatibilità con i browser</h2> + + + +<p>{{Compat("api.Document.head")}}</p> + +<h2 id="Vedi_anche">Vedi anche</h2> + +<ul> + <li>{{domxref("document.body")}}</li> +</ul> |
