Reputation: 540
In IE a <a href="javascript:;></a>
can be disabled by setting property disabled="true"
, but it does not work for Chrome. I don't want it trigger any event while clicking. (event.preventDefault(), event.stopPropagation()
don't work for me).
How can I disable it in Chrome just like in IE?
Thanks!
Upvotes: 0
Views: 695
Reputation: 2107
Instead of using <a href="javascript:;></a>
Why not use, <a onclick="javascript:;></a>
?
function helloWorld() {
alert("Hello World!");
}
<a onclick="helloWorld()">Click Me</a>
Upvotes: 1