<!DOCTYPE html>
<html lang="en-US">
<body>
<a name="JavaScript" href="/js">Learn JavaScript</a><br><br>
<a name="jQuery" href="/jquery">Learn jQuery</a>
<p>Click the button</p>
<button onclick="myFunction()">Click Me</button>
<p id="point"></p>
<script>
var x = document.getElementById("point");
function myFunction(){
x.innerHTML = document.anchors.item(0).innerText
}
</script>
<p><strong>Note</strong>: document.anchors is deprecated</p> </body>
</html>