Its a bit difficult to explain, but i will try.
Whenever someone clicks on a anchor link, temporarly a dotted box appears around it. For example, when you click on the stackoverflow logo over the top of this page, it is surrounded by a dotted line temporarily. Because the page gets refreshed, the dotted box goes away.
But with ajax, the link doesnt get refresh, hence the dotted box remains on it. How to remove that dotted box. When you click somewhere on the page the dotted box goes away. How to do it using jquery or any other way.
JavaScript Code: ready(function(){ $('#button1'). click(function(){ $("a"). removeAttr('href'); }); }); HTML.
To essentially disable it, you could likely do: $("a[href='http://www.google.com']").click(function(e) { e. preventDefault(); });
Disable a link #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.
To un-select it you can trigger the blur
event on the anchor element, for example:
$('a').click(function () {
this.blur(); // or $(this).blur();
//...
});
element.blur()
will remove the keyboard focus from the current element.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With