How to disable href if there's an onclick method?

How to disable href if there's an onclick method? 

In Blazor let's suppose  I have an <a> element that has both a href and an onclick method then how can I disable href. In this scenario, we can prevent default action in the anchor link on click event. 

Example : 


        
    <a href ="" @onclick="@DoAction" @onclick:preventDefault />



Reactions

Post a Comment

0 Comments