-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwinner.html
30 lines (29 loc) · 1.13 KB
/
winner.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div>
<h1 id="test">Vraag 11</h1>
<p>de laatste vraag, hoeveel vragen waren er</p>
<label for="answer">Answer: </label>
<input type="number" id="answer">
<input type="submit" id="button">
<script>
document.getElementById("button").addEventListener("click", checkAnswer); // Checks for answer to be submitted
function checkAnswer(){ // Code that runs once answer is submitted
var answer = document.getElementById("answer").value; // Gets answer
if(answer == 10){ // Checks if answer is correct
window.location.href = 'W.html'; // Directs to next question
}else{ // Wrong answer
alert("Doe er maar 1 of bij of erop");
}
};
</script>
</div>
</body>
</html>