Asked by Mrs. Sue.
this code isnt working it isnt saying correct when you choose correct answer and it isnt saying incorrect when it is incorrect
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name = "viewport" content="width=device-width", initia] <
<title>Simple Quiz</title
<link> rel="stylesheet" type="text/css" href="style.sheet" /
</head>
<body>
<h2>How do you say "Straight Ahead" in Spanish</h2>
<button id="option1">Justo ale Frentas</button>
<button id="option2">Todo Recto</button>
<button id="option3">Justo ala Frente</button>
<button id="option4">Justo al Frenta</button>
<p id="result" style="display: none"></p>
<script>
const correctAnswer = "Todo Recto"
const buttons =document.querySelectorAll("button");
const resultMessage = document.getElementById("result")
buttons.forEach((button) => {
button.addEventListener("click", () => {
if (button.textContent === correctAnswer) {}
resultMessage.textContent = "Correct!";
} else {
resultMessage.textContent = "Try again";
}
resultMessage.style.display = "block";
});
});
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name = "viewport" content="width=device-width", initia] <
<title>Simple Quiz</title
<link> rel="stylesheet" type="text/css" href="style.sheet" /
</head>
<body>
<h2>How do you say "Straight Ahead" in Spanish</h2>
<button id="option1">Justo ale Frentas</button>
<button id="option2">Todo Recto</button>
<button id="option3">Justo ala Frente</button>
<button id="option4">Justo al Frenta</button>
<p id="result" style="display: none"></p>
<script>
const correctAnswer = "Todo Recto"
const buttons =document.querySelectorAll("button");
const resultMessage = document.getElementById("result")
buttons.forEach((button) => {
button.addEventListener("click", () => {
if (button.textContent === correctAnswer) {}
resultMessage.textContent = "Correct!";
} else {
resultMessage.textContent = "Try again";
}
resultMessage.style.display = "block";
});
});
</script>
</body>
</html>
Answers
There are no human answers yet.
There are no AI answers yet. The ability to request AI answers is coming soon!
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.