$('a').removeAttr('href')
or
$('a').click(function(){ return false})
It depends on situation
This is the method I used to disable.Hope it helps.
$("#ThisLink").attr("href","javascript:;");
Simply in SASS:
.some_class{
// styles...
&.active {
pointer-events:none;
}
}
$('#ThisLink').one('click',function(){
$(this).bind('click',function(){
return false;
});
});
This would be another way to do this, the handler with return false
, which will disable the link, will be added after one click.
Just remove the href
attribute from the anchor tag.
Add a css
class:
.disable_a_href{
pointer-events: none;
}
Add this jquery
:
$("#ThisLink").addClass("disable_a_href");