You need to stop the default action of the "submit" event, which is to reload the page.
Change the form tag to:
<form onsubmit='goTo(); return false'>
You could alternatively do this by explicitly preventing the default action by manipulating the event object, but I think returning false
from the handler is pretty universal.