Although that link is disabled, it's still clickable.
<a href="/" disabled="disabled">123n</a>
Can I make it not-clickable if it's disabled? Should I use JavaScript necessarily?
33 Answers
With the help of css you will disable the hyperlink. Try the below
a.disabled {
pointer-events: none;
cursor: default;
}
<a href="link.html" class="disabled">Link</a>
There is no disabled attribute for hyperlinks. If you don't want something to be linked then you'll need to remove the <a> tag altogether.
Alternatively you can remove its href attribute - though this has other UX and Accessibility issues as noted in the comments below so is not recommended.
You can use:
<a href="/" onclick="return false;">123n</a>
You can use one of these solutions:
HTML
<a>link</a>