Marvel or DC let see! Take this questionnaire to test your knowledge! Shang-Chi Marvel DC Hawkgirl DC
Question:
Marvel or DC let see!
Take this questionnaire to test your knowledge!
document.addEventListener("DOMContentLoaded", function() {
document.getElementById("submit").addEventListener("click", tabulateAnswers);
document.getElementById("reset").addEventListener("click", resetAnswer);
});
function tabulateAnswers() {
var choices = document.getElementsByTagName("input");
var c1score = 0;
var c2score = 0;
for (var i = 0; i < choces.length; i++) {
if (choices[i].checked) {
if (choices[i].value === 'c1') {
c1score++;
}
if (choices[i].value === 'c2') {
c2score++;
}
}
}
var maxscore = 10;
var answerbox = document.getElementById("answer");
if (c1score === maxscore) {
answerbox.innerHTML = "You are an expert the score is: " + c1score + "/" + maxscore;
}
else if (c1score < maxscore) {
answerbox.innerHTML = "You did good, but could be better!" + c1score + " " + maxscore;
}
else if (c1score === c2score) {
answerbox.innerHTML = "You got half right!";
}
else if (c1score < c2score) {
answerbox.innerHTML = "You are not completely wrong!";
}
else {
answerbox.innerHTML = "You do not like fantasy shows!";
}
}
fix the code and show count the radio buttons?
Accounting Information Systems
ISBN: 9780132871938
11th Edition
Authors: George H. Bodnar, William S. Hopwood