this is an active link
<a href="#" class="btn btn-large">Link</a>
how to disable this link using javascript, so the code would be like this?
<a href="#" class="btn btn-large disabled">Link</a>
this is an active link
<a href="#" class="btn btn-large">Link</a>
how to disable this link using javascript, so the code would be like this?
<a href="#" class="btn btn-large disabled">Link</a>
HTML
<a href="#" id="myLink" class="btn btn-large">Link</a>
Pure JS
var d = document.getElementById("myLink");
d.className = d.className + " disabled";
jQuery
$('#myLink').addClass('disabled');
$('#myLink').on('click', function(e) { e.preventDefault(); });.btn:disabled has pointer-events:none so it will not be clickable.