Return the hostname of the URL for a specific area in an image-map:
The result of x will be:
The hostname property sets or returns the hostname part of the href attribute value.
The href attribute specifies the destination of a link in an area.
The hostname property is supported in all major browsers.
Return the hostname property:
Set the hostname property:
Value | Description |
---|---|
hostname | Specifies the hostname of a URL |
Return Value: | A String, representing the domain name (or IP address) of the URL |
---|
Change the hostname of a specific area in an image-map:
JavaScript reference: location.hostname Property