HTML domain Property
Example
Get the domain name of the server that loaded the document:
var x = document.domain;
The result of x will be:
www.w3schools.com
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