views:

39

answers:

1

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?

+3  A: 
<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 :)

oedo
isnt there any shorter syntax to accomplish the same effect?
David
possibly `<a href="javascript;">Go here</a>` would work too, but you already stated that :)
oedo