Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Preventing javascript:void(0) links from showing link address on hover

I have a javascript web application that contains lots of clickable elements that are currently all <a href='javascript:void(0)'> elements. Because there are so many links, as the user hovers over the page, javascript:void(0) flickers on and off in the lower left hand corner of browsers such as chrome and firefox which is annoying and ugly.

I know that I should leave these elements as links for accessibility and mobile friendliness. Is there a way to prevent this behavior in the browser? Alternatively I could convert all of the <a href='javascript:void(0)'> tags to <div> tags on the fly for non-touch browsers but that seems messy.

like image 366
Brian Peacock Avatar asked Jun 08 '13 20:06

Brian Peacock


1 Answers

Those elements aren't hyperlinks in the first place, so replace them with <span> elements styled with cursor:pointer (and no href attribute).

like image 174
phihag Avatar answered Nov 08 '22 14:11

phihag