Skip to content

Commit

Permalink
Refactor label.innerHTML to label.textContent in checkAnswers function
Browse files Browse the repository at this point in the history
  • Loading branch information
muznyo committed Jan 13, 2024
1 parent 67713b7 commit 4d51b66
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion script.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 4d51b66

Please sign in to comment.