Question: What is the capital of France?
function checkAnswer() {
var selectedOption = document.querySelector(‘input[name=”answer”]:checked’);
if (selectedOption) {
var answer = selectedOption.value;
if (answer === “a”) {
alert(“Correct answer!”);
} else {
alert(“Wrong answer. Please try again.”);
}
} else {
alert(“Please select an answer.”);
}
}