<!DOCTYPE html>
<html>
<head>
<title>Simple Quiz Game</title>
</head>
<body>
<h1>Quiz Game</h1>
<p>Click the button below to start the quiz:</p>
<button onclick="startGame()">Start Quiz</button>
<p id="question"></p>
<script>
const questions = [
"What is the capital of France?",
"What is 2 + 2?",
"What color is the sky?"
];
let currentQuestion = 0;
function startGame() {
document.getElementById("question").innerText = questions[currentQuestion];
}
</script>
</body>
</html>
Code for a simple Start game no check answer and 3 questions Javascript
1 answer