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?


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.

ps.

Removing href attribute is sufficient.


With the help of css you will disable the hyperlink. Try the below

<a href="link.html" class="disabled">Link</a>

a.disabled {
   pointer-events: none;
   cursor: default;
}

您可以使用:

<a href="/" onclick="return false;">123n</a>
链接地址: http://www.djcxy.com/p/19528.html

上一篇: jQuery $(文档).ready和UpdatePanels?

下一篇: 禁用href标记