@@ 2,19 2,19 @@ let choices = []
let current
for (let choice of document.querySelectorAll("a")) {
- choice.onclick = function (event) {
+ choice.addEventListener('click', function (event) {
event.preventDefault()
current.classList.remove("visible")
choose(this.hash.substr(1))
- }
+ })
}
const restart = document.getElementById("restart")
if (restart) {
restart.style.display = "none"
- restart.onclick = function (event) {
- window.location.reload()
- }
+ restart.addEventListener('click', function (event) {
+ this.style.display = "none"
+ })
}
function choose(id) {