--- title: Document.head slug: Web/API/Document/head translation_of: Web/API/Document/head ---
{{APIRef("DOM")}}
Retorna o elemento {{HTMLElement("head")}} do documento atual. Se existir mais de um elemento <head>, apenas o primeiro será devolvido.
var objRef = document.head;
// No HTML: <head id="my-document-head">
var aHead = document.head;
alert(aHead.id); // "my-document-head";
alert( document.head === document.querySelector("head") ); // true
document.head suporta apenas leitura. Qualquer tentativa de atribuir um valor a essa propriedade irá falhar silenciosamente ou irá, usando o modo ECMAScript Strict de um browser Gecko, disparar um TypeError.
| Especificação | Status | Comentário |
|---|---|---|
| {{SpecName("HTML5 W3C", "dom.html#dom-tree-accessors", "document.head")}} | {{Spec2("HTML5 W3C")}} | Definição inicial |
| Recurso | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|
| Suporte básico | 4.0 | {{CompatGeckoDesktop("2")}} | 9.0 | 11.0 | 5.0 |
| Recurso | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|
| Suporte básico | {{CompatVersionUnknown}} | {{CompatGeckoMobile("2")}} | 9.0 | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} |