Edit This Code:
<!DOCTYPE html>
<html>
<body>

<a id="myAnchor" href="../index.html">A Link: Go to w3schools.com</a>

<p id="demo">Click the button to remove the href attribute from the a element.</p>

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

<script>
function myFunction() {
    document.getElementById("myAnchor").removeAttribute("href");
}
</script>

</body>
</html>


Result:
Try it Yourself - © w3schools.com
Privacy Policy