From 1511e7a5556531b820d448f9a72676fe3110c18c Mon Sep 17 00:00:00 2001 From: LinlyBoi Date: Mon, 4 Dec 2023 14:10:59 +0200 Subject: [PATCH] who wrote this shit --- index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 500d596..1e93258 100644 --- a/index.js +++ b/index.js @@ -100,12 +100,13 @@ const questions = [ console.log(questions); function setQ(n) { - var question = Document.getElementById("question") + var question = document.getElementById("question") question.innerText = questions[n].title; } var questionCounter = 0; function nextQ() { + if (questionCounter < questions.length) questionCounter++; setQ(questionCounter); if (questionCounter < questions.length) @@ -115,6 +116,8 @@ function prevQ() { questionCounter--; setQ(questionCounter); if (questionCounter > 0) + questionCounter--; + setQ(questionCounter); } }