Possible Duplicate:
How do I stop a web page from scrolling to the top when a link is clicked that triggers javascript?
When I click on a date of a jQuery datepicker on my web page, my page repositions itself to the top because the date on the datepicker has an href="#"
attribute.
It seems that whenever I click an <a>
element that has href="#"
then my page reorientates iteself to display from the top of the page. This is pretty annoying because the user is having to cope with the page moving about and may even have to scroll just to see the part of the page they were using before they clicked. Can anyone tell me how I can stop this from happening?
I can take the href
attribute from some of my links, but jQuery widgets often have them in.
Many thanks