Answers for "disable an anchor tag javascript"

0

how to enable and disable href in javascript

// Example link
// <a id="my-link" href="https://codegrepper.com">Text</a>
var a = document.getElementById("my-link");
a.originalLink = a.href;
// disable link
a.href = 'javascript:void(0)';
// re-enable link
a.href = a.originalLink;
Posted by: Guest on March-17-2021
1

disable an anchor tag

<a href="link.html" class="disabled">Link</a>
Posted by: Guest on June-13-2021

Browse Popular Code Answers by Language