JavaScript Window location.hostname
JavaScript Window location.hostname
The location.hostname property is used to return the host IP adress or domain of a URL. We can also set it in order to navigate the same URL but with a different hostname.
Syntax:-
Its syntax is:- location.hostname OR location.hostname = hostname
Return:-
Its return is:- a string containing a host IP address or domain
Further Explanation:-
Value | Description |
hostname | The hostname of the URL. |