Is there a better way to 'fake' the href attribute for links?

html, javascript

Solution

Not sure what you are trying to do, but you can also use `href="#"` and use unobtrusive javascript to stop the click event from continuing.

Problem

Right now I use: ``` href="javascript:void(0)" ``` for my a tags. However, I find this messy, and it is also displayed to the user in FireFox on a hover. What I'm considering doing is replacing my links with just plain p tags and setting up event handlers in JavaScript. Clarification: This is for modern JavaScript enabled browsers only. I'm not yet currently concerned accessibility.

Original source

Related problems