Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<h1>The Anchor Object</h1>
<h2>The href Attribute</h2>
<p><a id="myAnchor" href="default.asp">JavaScript and HTML DOM Reference</a></p>
<p id="demo"></p>
<script>
let text = document.getElementById("myAnchor").innerHTML;
document.getElementById("demo").innerHTML = "The text of the link abouve is " + text;
</script>
</body>
</html>