Location host property
Definition and Usage
host property is a readable and writable string sets or returns the host name and port number of the current URL.
grammar
location.host
Browser Support
All major browsers support host properties
Examples
Examples
Returns the host name and port of the current URL:
<script>
document.write(location.host);
</script>
document.write(location.host);
</script>
Examples of the above output ::
try it"
Location Object