Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 547
Alan Coromano Avatar asked Dec 19 '12 15:12

Alan Coromano


People also ask

Can we disable a href?

It is still possible to disable a link by following 3 steps: remove the href attribute so that it can no longer receive the focus. add a role="link" so that it is always considered a link by screen readers. add an attribute aria-disabled="true" so that it is indicated as being disabled.

How do I enable hyperlinks in HTML?

To make a hyperlink in an HTML page, use the <a> and </a> tags, which are the tags used to define the links. The <a> tag indicates where the hyperlink starts and the </a> tag indicates where it ends. Whatever text gets added inside these tags, will work as a hyperlink. Add the URL for the link in the <a href=” ”>.


1 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>
like image 79
Lakhan Avatar answered Sep 19 '22 12:09

Lakhan