Skip to content

Disabled href tag

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?

Answer

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.