aboutsummaryrefslogtreecommitdiff
path: root/files/pt-br/web/api/document/head/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/pt-br/web/api/document/head/index.html')
-rw-r--r--files/pt-br/web/api/document/head/index.html102
1 files changed, 102 insertions, 0 deletions
diff --git a/files/pt-br/web/api/document/head/index.html b/files/pt-br/web/api/document/head/index.html
new file mode 100644
index 0000000000..af0331459f
--- /dev/null
+++ b/files/pt-br/web/api/document/head/index.html
@@ -0,0 +1,102 @@
+---
+title: Document.head
+slug: Web/API/Document/head
+translation_of: Web/API/Document/head
+---
+<p>{{APIRef("DOM")}}</p>
+
+<p>Retorna o elemento {{HTMLElement("head")}} do documento atual. Se existir mais de um elemento <code>&lt;head&gt;</code>, apenas o primeiro será devolvido.</p>
+
+<h2 id="Syntax" name="Syntax">Sintaxe</h2>
+
+<pre class="syntaxbox"><em>var objRef</em> = document.head;
+</pre>
+
+<h2 id="Example" name="Example">Exemplo</h2>
+
+<pre class="brush: js">// No HTML: &lt;head id="my-document-head"&gt;
+var aHead = document.head;
+
+alert(aHead.id); // "my-document-head";
+
+alert( document.head === document.querySelector("head") ); // true
+</pre>
+
+<h2 id="Example" name="Example">Notas</h2>
+
+<p><code>document.head</code> suporta apenas leitura. Qualquer tentativa de atribuir um valor a essa propriedade irá falhar silenciosamente ou irá, usando o modo <a href="/en-US/docs/Web/JavaScript/Reference/Functions_and_function_scope/Strict_mode">ECMAScript Strict</a> de um browser Gecko, disparar um <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError"><code>TypeError</code></a>.</p>
+
+<h2 id="Especificações">Especificações</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Especificação</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comentário</th>
+ </tr>
+ <tr>
+ <td>{{SpecName("HTML5 W3C", "dom.html#dom-tree-accessors", "document.head")}}</td>
+ <td>{{Spec2("HTML5 W3C")}}</td>
+ <td>Definição inicial</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Compatibilidade_entre_Browsers">Compatibilidade entre Browsers</h2>
+
+<div>{{CompatibilityTable}}</div>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Recurso</th>
+ <th>Chrome</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari</th>
+ </tr>
+ <tr>
+ <td>Suporte básico</td>
+ <td>4.0</td>
+ <td>{{CompatGeckoDesktop("2")}}</td>
+ <td>9.0</td>
+ <td>11.0</td>
+ <td>5.0</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Recurso</th>
+ <th>Android</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>IE Mobile</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ </tr>
+ <tr>
+ <td>Suporte básico</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatGeckoMobile("2")}}</td>
+ <td>9.0</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<h2 id="sect1"> </h2>
+
+<h2 id="Veja_Também">Veja Também</h2>
+
+<ul>
+ <li>{{domxref("document.body")}}</li>
+</ul>