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