location.hostname displays current page domain name or host name with port (if specified in URL)
Output