Search w3schools.com:

SHARE THIS PAGE

Document domain Property

Document Object Reference Document Object

Definition and Usage

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

Syntax

document.domain


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The domain property is supported in all major browsers.


Example

Example

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

<html>
<body>

The domain name for the server that loaded this document:
<script>
document.write(document.domain);
</script>

</body>
</html>

Try it yourself »


Document Object Reference Document Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]