HTML DOM host Property
Definition and Usage
The host property sets or returns the hostname and port number of the current
URL.
Syntax
Example
Assume that the current URL is: http://example.com/test.htm#part2:
<html>
<body>
<script type="text/javascript">
document.write(location.host);
</script>
</body>
</html>
|
Output:
Try-It-Yourself Demos
Use the host
property of the location object
|
|
|
See why there are 20,000+ Ektron integrations worldwide.
Request an INSTANT DEMO or download a FREE TRIAL today. |
|
|
|