<html>
<body>
<h1>The Anchor Object</h1>
<h2>Access an a Element</h2>
<a id="myAnchor" href="https://www.w3schools.com">Tutorials</a>
<p>Click "Try it" to get the URL of the link.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
const element = document.getElementById("myAnchor").href;
document.getElementById("demo").innerHTML = element;
}
</script>
</body>
</html>