0

I'm using a blank link to toggle a div through Jquery and in the link I have a blank link which allows you to click on the text to toggle the div but when you click toggle text the page jumps to the top. Is there a way to prevent this?

<a href="#" id="searchAnchor">Search Options</a>
Greenhoe
  • 1,051
  • 4
  • 18
  • 41
  • Solution here: http://stackoverflow.com/questions/6572522/sole-hash-in-anchor-href – WP_ Dec 14 '13 at 23:42

1 Answers1

2

Use an <input type="button"> if you don't want the functionality of a link. Style it to look however you like.

(Alternatively, call preventDefault() on the event object, but that still leaves you with a link that isn't a link).

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335