Reputation: 1051
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>
Upvotes: 0
Views: 124
Reputation: 943211
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).
Upvotes: 2