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

后端 未结 18 2076
清酒与你
清酒与你 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:12

    The cleanest method would be to add a class with pointer-events:none when you want to disable a click. It would function like a normal label.

    .disableClick{
        pointer-events: none;
    }
    

提交回复
热议问题