THE WORLD'S LARGEST WEB DEVELOPER SITE

HTML DOM head Property

❮ Document Object

Example

Get the id of the <head> element of the current document:

var x = document.head.id;
Try it Yourself »

Definition and Usage

The head property returns the <head> element of the current document.

Note: If there are more than one <head> element in the document, this property returns the first one.


Browser Support

The numbers in the table specify the first browser version that fully supports the property.

Property
head 4.0 9.0 4.0 5.0 11.0

Syntax

document.head

Technical Details

Return Value: A reference to the Head Object, which represents a <head> element
DOM Version Core Level 3 Document Object

Related Pages

HTML reference: HTML <head> tag

JavaScript reference: HTML DOM Head Object


❮ Document Object