HTML DOM Document domain attribute
- Previous Page documentURI
- Next Page domConfig
- Go to the Previous Level HTML DOM Documents
Definition and usage
domain
Property returns the domain of the server (from where the document is loaded).
If the document is created in memory, then domain
Property returns null
.
See also:
Example
Returns the domain of the server loading this document:
let myDomain = document.domain;
Syntax
document.domain
Return value
Type | Description |
---|---|
String | The domain of the server (where the file is loaded from). |
null | If the domain cannot be recognized. |
Browser support
document.domain
It is a DOM Level 2 (2001) feature.
All browsers support it:
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Chrome | IE | Edge | Firefox | Safari | Opera |
Support | 9-11 | Support | Support | Support | Support |
- Previous Page documentURI
- Next Page domConfig
- Go to the Previous Level HTML DOM Documents