From d233fa5d1f0bdcaceb700175cd3fe4647a8c4def Mon Sep 17 00:00:00 2001 From: Adnan Maolood Date: Thu, 10 Feb 2022 13:18:03 -0500 Subject: [PATCH] Update cyoa --- static/games/cyoa/script.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/static/games/cyoa/script.js b/static/games/cyoa/script.js index 2186f82..eca85e4 100644 --- a/static/games/cyoa/script.js +++ b/static/games/cyoa/script.js @@ -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) { -- 2.34.2