Unsere Freiwilligen haben diesen Artikel noch nicht in Deutsch übersetzt. Machen Sie mit und helfen Sie, das zu erledigen!
Returns the <head>
element of the current document. If there are more than one <head>
elements, the first one is returned.
Syntax
var objRef = document.head;
Example
// in HTML: <head id="my-document-head"> var aHead = document.head; alert(aHead.id); // "my-document-head"; alert( document.head === document.querySelector("head") ); // true
Notes
document.head
is read-only. Trying to assign a value to this property will fail silently or, when in ECMAScript Strict Mode in a Gecko browser, throw a TypeError
.
Specifications
Specification | Status | Comment |
---|---|---|
WHATWG HTML Living Standard The definition of 'Document.head' in that specification. |
Living Standard | Initial definition. |
HTML5.1 The definition of 'Document.head' in that specification. |
Working Draft | |
HTML5 The definition of 'Document.head' in that specification. |
Recommendation |
Browser compatibility
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | 4.0 | 4.0 (2) | 9.0 | 11.0 | 5.0 |
Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | (Yes) | 4.0 (2) | 9.0 | (Yes) | (Yes) |
See Also
Schlagwörter des Dokuments und Mitwirkende
Schlagwörter:
Mitwirkende an dieser Seite:
cvrebert,
teoli,
Sebastianz,
Delapouite,
kscarfone,
Khodaidad_Basharmand,
Sheppy,
ethertank,
ziyunfei,
myakura,
dbruant,
Marcoos
Zuletzt aktualisiert von:
cvrebert,