Run ❯
Get your
own
website
Result Size:
625 x 565
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <body> <h1>The Anchor Object</h1> <h2>The host Attribute</h2> <p><a id="myAnchor" href="http://www.example.com:4097/test.htm#part2">Example link</a></p> <p>The value of the host attribute is:</p> <p id="demo"></p> <script> let text = document.getElementById("myAnchor").host; document.getElementById("demo").innerHTML = text; </script> </body> </html>