JavaScript » Link » hostname

Syntax:
object.hostname

The hostname property specifies the server name, subdomain and domain name (or IP address) of a URL.

hostname is a property of both the Link and the Location objects and specifies the server name, subdomain and domain name (or IP address) of a URL.

NOTE:
 
Although the hostname property can be set at any time, it is safer to set the href property to change a link.

Examples

Code:
document.write(document.links[0].hostname)
Output:
home.newco.com
Explanation:

Assuming a link (stored in the first element of the links property) to a URL ...
 
http://home.newco.com/products/enquiries.htm#local?email=name@otherco.com
 
...this code would display the hostname property of it.