<!DOCTYPE html>
<html>
<body>

<h3>A demonstration of how to access an A element</h3>

<a id="myAnchor" href="../index.html">Tutorials</a>

<p>Click the button to get the URL of the link.</p>

<button onclick="myFunction()">Try it</button>

<p id="demo"></p>

<script>
function myFunction() {
    var x = document.getElementById("myAnchor").href;
    document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>