showing results for - "how to enable and disable href in javascript"
Lucien
25 Sep 2017
1// Example link
2// <a id="my-link" href="https://codegrepper.com">Text</a>
3var a = document.getElementById("my-link");
4a.originalLink = a.href;
5// disable link
6a.href = 'javascript:void(0)';
7// re-enable link
8a.href = a.originalLink;
queries leading to this page
js disable href clickdisable href javascriptdisable link in jsdisable a link in javascriptjavascript disable linkhow can i disable href in script in jsdisable a link through jshow to make a link inactive with javascriptdisabled href javascriptdisable link jsdisable href link jshow to disable link jsdisable links jsdisable link a tag in javascriptjs disable url hrefsend disabled property disable link jsa href disable javascripthtml disable link javascriptdisable href in javascriptdisable the link in javascriptjavascript disable hrefdisable link in javascripthow to disable link to if condition in javascripthow to disable href in javascripthow to enable and disable href in javascriptdisable link using jsdisable link with javascripthow to disable link in html using javascriptwhy would js disable 3ca href 3e 3c 2fa 3e linkdisable link with jsjavascript disable a hrefdisable href jsdisable a link jsdisable hyperlink in javascripthow to disable a link in javascripthow can i disable all href in jshow to disable link javascripthow to disable a href in javascriptjs how to enable and disable linksend disable properti disable link jsjs disable linkdisable link javascripthow to disable link in javascriptenable disable hyperlink in javascriptdisable an anchor tag javascriptdisable anchor tag in javascriptdisable href link javascriptdisable a link with javascriptdisable a href javascripthow to disable a link tag with javascripthow to enable and disable href in javascript