HTML domainProperty
Document Object
Definition and Usage
The domain property can return the server domain from which the current document was downloaded:
Syntax
document.domain
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the domain property
Example
Example
Return the domain name of the server that downloaded the current document:
<html>
<body>
The domain name that loaded this file:
<script>
document.write(document.domain);
</script>
</body>
</html>
<body>
The domain name that loaded this file:
<script>
document.write(document.domain);
</script>
</body>
</html>
Try it Yourself »
Document Object Other Extensions