From 074785cea106179cb3305637055ab0a009ca74f2 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:42:52 -0500 Subject: initial commit --- files/pt-br/web/api/document/head/index.html | 102 +++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 files/pt-br/web/api/document/head/index.html (limited to 'files/pt-br/web/api/document/head') 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 +--- +

{{APIRef("DOM")}}

+ +

Retorna o elemento {{HTMLElement("head")}} do documento atual. Se existir mais de um elemento <head>, apenas o primeiro será devolvido.

+ +

Sintaxe

+ +
var objRef = document.head;
+
+ +

Exemplo

+ +
// No HTML: <head id="my-document-head">
+var aHead = document.head;
+
+alert(aHead.id); // "my-document-head";
+
+alert( document.head === document.querySelector("head") ); // true
+
+ +

Notas

+ +

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ções

+ + + + + + + + + + + + + + +
EspecificaçãoStatusComentário
{{SpecName("HTML5 W3C", "dom.html#dom-tree-accessors", "document.head")}}{{Spec2("HTML5 W3C")}}Definição inicial
+ +

Compatibilidade entre Browsers

+ +
{{CompatibilityTable}}
+ +
+ + + + + + + + + + + + + + + + + + + +
RecursoChromeFirefox (Gecko)Internet ExplorerOperaSafari
Suporte básico4.0{{CompatGeckoDesktop("2")}}9.011.05.0
+
+ +
+ + + + + + + + + + + + + + + + + + + +
RecursoAndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Suporte básico{{CompatVersionUnknown}}{{CompatGeckoMobile("2")}}9.0{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +

 

+ +

Veja Também

+ + -- cgit v1.2.3-54-g00ecf