From 4d51b66ec3089544722c627ecd0113c91c84010e Mon Sep 17 00:00:00 2001 From: muznyo Date: Sat, 13 Jan 2024 14:56:53 +0100 Subject: [PATCH] Refactor label.innerHTML to label.textContent in checkAnswers function --- script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script.js b/script.js index d011f38..0c2e5f5 100644 --- a/script.js +++ b/script.js @@ -153,7 +153,7 @@ function checkAnswers() { inputs.forEach((input, answerIndex) => { const label = document.querySelector(`label[for="q${questionIndex + 1}a${answerIndex}"]`); - const isCorrect = question.correctAnswers.includes(label.innerHTML); + const isCorrect = question.correctAnswers.includes(label.textContent); // Add class to the label based on whether the answer is correct or not if (isCorrect) {