How to disable a link in HTML?

I need to disable a link in the HTML file. Can we do this using JavaScript?

Comments

  • <style>
    .disabledLink{
        /*Disabled link style*/
        color:black;
    }
    </style>
    
    <a class="disabledLink" href="javascript:void(0)">Your disabled link</a>
    
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion