How do you make an anchor link non-clickable or disabled?

后端 未结 18 2074
清酒与你
清酒与你 2020-11-27 02:38

I have an anchor link that I want to disable once the user clicks on it. Or, remove the anchor tag from around the text, but definitely keep the text.



        
18条回答
  •  执笔经年
    2020-11-27 03:21

    $('#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.

提交回复
热议问题