Anchor with onclick

I want two things to happen when someone clicks a hyperlink: 1) automatic scroll to the top of the page. 2) a JS function gets called.


<a href="#topOfSite" onclick="someFunction()">click here</a>

Why is it only going to the top of the site but not calling the function?