How to find the name of the internet host using javascript

Manideepgoud
Posted by Manideepgoud under JavaScript category on | Points: 40 | Views : 333
We use window.location.hostname to find the host name.

<p id="find"></p>
<script>
var a = document.getElementById("find").innerHTML =
"Page hostname is: " + window.location.hostname;
</script>


OUTPUT

It apppears as www.dotnetfunda.com

Comments or Responses

Login to post response