Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<h2>JavaScript</h2>
<h3>The window.location object</h3>
<p id="demo"></p>
<script>
document.getElementById("demo").innerHTML = 
"Page hostname is: " + window.location.hostname;
</script>
</body>
</html>