Return the hostname of the current URL:
The result of x will be:
The hostname property sets or returns the hostname of a URL.
Property | |||||
---|---|---|---|---|---|
hostname | Yes | Yes | Yes | Yes | Yes |
Return the hostname property:
Set the hostname property:
Value | Type | Description |
---|---|---|
hostname | String | Specifies the hostname of the URL |
Return Value: | A String, representing the domain name, or the IP address of a URL |
---|