HTML DOM domain Property
THE WORLD'S LARGEST WEB DEVELOPER SITE

HTML domain Property

❮ Document Object

Example

Get the domain name of the server that loaded the document:

var x = document.domain;
Try it Yourself »

Definition and Usage

The domain property returns the domain name of the server that loaded the current document.


Browser Support

Property
domain Yes Yes Yes Yes Yes

Syntax

document.domain

Technical Details

Return Value: A String, representing the domain name of the server that loaded the current document, or null if the domain of the document cannot be identified
DOM Version Core Level 2 Document Object

❮ Document Object