Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<h1>The Anchor Object</h1>
<h2>The host Attribute</h2>
<p><a id="myAnchor" target="_blank" href="http://www.example.com:443/test.htm#part2">Example link</a></p>
<p>The value of the host attribute is:</p>
<p id="demo"></p>
<script>
document.getElementById("myAnchor").host = "www.somenewexamplepage.com:344";
document.getElementById("demo").innerHTML = document.getElementById("myAnchor").host;
</script>
</body>
</html>