who wrote this shit
This commit is contained in:
5
index.js
5
index.js
@@ -100,12 +100,13 @@ const questions = [
|
|||||||
console.log(questions);
|
console.log(questions);
|
||||||
|
|
||||||
function setQ(n) {
|
function setQ(n) {
|
||||||
var question = Document.getElementById("question")
|
var question = document.getElementById("question")
|
||||||
question.innerText = questions[n].title;
|
question.innerText = questions[n].title;
|
||||||
|
|
||||||
}
|
}
|
||||||
var questionCounter = 0;
|
var questionCounter = 0;
|
||||||
function nextQ() {
|
function nextQ() {
|
||||||
|
if (questionCounter < questions.length)
|
||||||
questionCounter++;
|
questionCounter++;
|
||||||
setQ(questionCounter);
|
setQ(questionCounter);
|
||||||
if (questionCounter < questions.length)
|
if (questionCounter < questions.length)
|
||||||
@@ -115,6 +116,8 @@ function prevQ() {
|
|||||||
questionCounter--;
|
questionCounter--;
|
||||||
setQ(questionCounter);
|
setQ(questionCounter);
|
||||||
if (questionCounter > 0)
|
if (questionCounter > 0)
|
||||||
|
questionCounter--;
|
||||||
|
setQ(questionCounter);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user