Seeint the hash should do the job. If you have a header, you can use
window.location.href = "#headerid";
otherwise, the # alone will work
window.location.href = "#";
And as it get written into the url, it'll stay if you refresh.
In fact, you don't event need JavaScript for that if you want to do it on an onclick event, you should just put a link arround you element and give it # as href.