Return the hostname and port number of a link:
The result of x will be:
The host property sets or returns the hostname and port part of the href attribute value.
Note: If the port number is not specified in the URL (or if it is the scheme's default port - like 80, or 443), some browsers will not display the port number.
The host property is supported in all major browsers.
Return the host property:
Set the host property:
|hostname:port||Specifies the hostname and port number of a URL|
|Return Value:||A String, representing the domain name (or IP address) and port number of the URL|
Change the hostname and port number of a link:
Another example of how to change the hostname and port number of a link: