<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Index</title>
</head>
<body>
<div
id="prob1">
<label id = "prob1-label">1. 5 + 9 = </label><br>
<button id = "prob1-submit">Submit answer</button>
<button id = "prob1-check">Check answer</button>
</div>
<div
id="prob2">
<label id = "prob2-label">2. 4 * 6 = </label><br>
<button id = "prob2-submit">Submit answer</button>
<button id = "prob2-check">Check answer</button>
</div>
<div
id="prob3">
<label id = "prob3-label">3. 25 - 14 = </label><br>
<button id = "prob3-submit">Submit answer</button>
<button id = "prob3-check">Check answer</button>
</div>
<div
id="prob4">
<label id = "prob4-label">4. 48 / 3 = </label><br>
<button id = "prob4-submit">Submit answer</button>
<button id = "prob4-check">Check answer</button>
</div>
<div
id="prob5">
<label
id = "prob5-label">5. 26 % 6 = </label><br>
<button
id = "prob5-submit">Submit answer</button>
<button
id = "prob5-check">Check answer</button>
</div>
<script>
var result1, result2, result3, result4,
result5;
document.getElementById("prob1-submit").addEventListener("click",
function(){
result1
= parseInt(prompt(document.getElementById('prob1-label').innerText));
});
document.getElementById("prob1-check").addEventListener("click",
function(){
if(5+9
== result1)
alert("correct");
else
alert("incorrect");
});
document.getElementById("prob2-submit").addEventListener("click",
function(){
result2
= parseInt(prompt(document.getElementById('prob2-label').innerText));
});
document.getElementById("prob2-check").addEventListener("click",
function(){
if(4*6
== result2)
alert("correct");
else
alert("incorrect");
});
document.getElementById("prob3-submit").addEventListener("click",
function(){
result3
= parseInt(prompt(document.getElementById('prob3-label').innerText));
});
document.getElementById("prob3-check").addEventListener("click",
function(){
if(25-14
== result3)
alert("correct");
else
alert("incorrect");
});
document.getElementById("prob4-submit").addEventListener("click",
function(){
result4
= parseInt(prompt(document.getElementById('prob4-label').innerText));
});
document.getElementById("prob4-check").addEventListener("click",
function(){
if(48/3
== result4)
alert("correct");
else
alert("incorrect");
});
document.getElementById("prob5-submit").addEventListener("click",
function(){
result5
= parseInt(prompt(document.getElementById('prob5-label').innerText));
});
document.getElementById("prob5-check").addEventListener("click",
function(){
if(26%6
== result5)
alert("correct");
else
alert("incorrect");
});
</script>
</body>
</html>