Returns the <head> element of the current document. If there are more than one <head> elements, the first one is returned.


var objRef = document.head;


// in HTML: <head id="my-document-head">
var aHead = document.head;

alert(; // "my-document-head";

alert( document.head === document.querySelector("head") ); // true


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.


Specification Status Comment
HTML Living Standard
The definition of 'Document.head' in that specification.
Living Standard Initial definition.
HTML 5.1
The definition of 'Document.head' in that specification.
The definition of 'Document.head' in that specification.

Browser compatibility

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

Feature Chrome Edge Firefox (Gecko) Internet Explorer Opera Safari
Basic support 4.0(Yes) 4.0 (2) 9.0 11.0 5.0
Feature Android Edge Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support (Yes)(Yes) 4.0 (2) 9.0 (Yes) (Yes)

See Also

Document Tags and Contributors

 Last updated by: erikadoyle,