Is there a way?

Is there a way to dynamically call a function AND redirect to a new URL with an anchor tag?

More specifically, I have a page that has content populated with multiple divs, of which all but 1 are hidden at any given time. Currently, there is on-page navigation that calls javascript to hide and display the appropriate div. Is there a way I can put a link on my dropdown menus that will load the page then call the function with a value based upon the link that was used?