document.getElementById("anmeldebutton").addEventListener("submit", Redirect); function Redirect() { window.location = sessionStorage.getItem("clicked-last") sessionStorage.removeItem("clicked-last") return true }