Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Marvel or DC let see! Take this questionnaire to test your knowledge! Shang-Chi Marvel DC Hawkgirl DC Marvel Thanos Marvel DC Batman DC Marvel Luke












Marvel or DC let see!


Take this questionnaire to test your knowledge!








Shang-Chi










Hawkgirl








Thanos








Batman








Luke Cage








Mr. Freeze








Hulk








Joker








Spiderman








Black Adam











Your result will show up here!




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?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Accounting Information Systems

Authors: George H. Bodnar, William S. Hopwood

11th Edition

0132871939, 978-0132871938

More Books

Students also viewed these Programming questions

Question

When should you avoid using exhaust brake select all that apply

Answered: 1 week ago

Question

A credit sale is not a complete transaction. Discuss.

Answered: 1 week ago