Last active
June 30, 2016 11:45
-
-
Save mir4ef/c86812b6bec1be0d274199f4c052cb28 to your computer and use it in GitHub Desktop.
Disable anchor tag with either css or javascript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- using CSS --> | |
<head> | |
<style> | |
.my-disabled-link { | |
cursor: default; | |
pointer-events: none; | |
} | |
</style> | |
</head> | |
<body> | |
<a href='my-url.com' class='my-disabled-link'>my disabled link</a> | |
</body> | |
<!-- using JavaScript --> | |
<body> | |
<a href='my-url.com' onclick='return false;'>my disabled link</a> | |
</body> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment