How to Disable a Anchor Tag in HTML using css, jquery and javascript ?

you want to disable anchor tag in html using css, jquery and javascript. you will learn how to disable a tag in html.

I am explaining you, how to disable anchor tag in html using css. let’s see example :

Example 1 :

<!DOCTYPE html>
<html>
<head>
    <title>How to Disable a Anchor Tag in HTML using css ? </title>
    <style type="text/css">
        a.disabled {
          pointer-events: none;
          cursor: default;
          opacity: .6;
        }
    </style>
</head>
<body>
  
<h1>How to Disable a Anchor Tag in HTML using css ?</h1>
  
<a href="https://webdeveloperindia.in" class="disabled">https://webdeveloperindia.in</a>
  
</body>
</html>

I am explaining you, how to disable anchor tag in html using jQuery. let’s see example :

Example 2 :

 <!DOCTYPE html>
<html>
<head>
    <title>How to Disable a Anchor Tag in HTML using jQuery ?</title>
</head>
<body>
  
<h1>How to Disable a Anchor Tag in HTML using jQuery ?</h1>
  
<a href="https://webdeveloperindia.in" onclick="return false;">https://webdeveloperindia.in</a>
  
</body>
</html>

I am explaining you, how to disable anchor tag in html using javascript. let’s see example :

Example 3 :

 <!DOCTYPE html>
<html>
<head>
    <title>How to Disable a Anchor Tag in HTML using javascript ?</title>
</head>
<body>
  
<h1>How to Disable a Anchor Tag in HTML using javascript ?</h1>
  
<a href="javascript:void(0);">https://webdeveloperindia.in</a>
  
</body>
</html>

Leave a Reply

Your email address will not be published. Required fields are marked *

79 + = 80