Question

When protyping we often do empty anchors. A very common way to do this is to do something like:

<a href="#">Go here</a>

But if the client clicks this link, the page will scroll to the top. But if we leave out the href attribute, the link won't behave like a link.

I've see stuff like:

<a href="javascript;">Go here</a>

But it doesn't look right.

Any other ideas?

Was it helpful?

Solution

<a href="javascript:void(0);">Go here</a>

will do nothing when you click on it. i think the 'standard' is to just use a # though and tell the client that it's a prototype and so links will not function properly :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top