자키, css, html 및 jquery로 작성된 퀴즈가있는 웹 사이트의 javascipt에서이 프로젝트를하고 있습니다. 점수를 얻는 데 문제가있었습니다. 결과 섹션을로드 할 때 퀴즈가 끝날 때 문제가 발생합니다. 퀴즈가 끝날 때마다 똑같은 번호로 나옵니다. 1/6.JavaScript 퀴즈 득점 기능
function showScore()
{
document.getElementById("Score").innerHTML = "You Got " + answers + "/6";
console.log("Score is displayed.");
}
그리고 질문 :
<div id="questions1">
<h1>Question 1.</h1>
<br>
Why are there data types in JavaScript?
<br>
<br><input type="radio" name="q1" value="A" id="1A" onchange="question1()">As it helps a computer differentiate between different data.
<br><input type="radio" name="q1" value="B" id="1B" onchange="question1Wrong1()">There aren't.
<br><input type="radio" name="q1" value="C" id="1C" onchange="question1Wrong2()">To help it interact with Java.
<br><input type="radio" name="q1" value="D" id="1D" onchange="question1Wrong3()">To allow it to complete a task.
<br>
<input type="button" value="Next" onclick="nextQuestion();answerTotals()">
<br>
<br>
<p onclick="hint1()">
</div>
희망은 자바 스크립트 퀴즈가 아닙니다! (lighthearted, 실제로는 뜻이 아니다) – tigertrussell