So, I would like to know a simple way in which I could make the answers they submit in the prompt appear as either correct or incorrect preferably by writing it on the page.. Please help? Thanks.
<html>
<body>
<script type="text/javascript">
confirm("Are you ready?")
var score = 0;
var question =
[
"2 + 2 = ?",
"2 + 3 = ?",
"5 + 5 = ?",
"3 + 3 = ?",
"6 + 5 = ?",
"6 + 12 = ?"
];
question.sort(function(){
return Math.round(Math.random());
});
var answer =
[
"4",
"5",
"10",
"6",
"11",
"18"
];
for (var i = 0; i < 6; i++)
{
var prompt1 = prompt(question[i]);
}
</script>
</body>
</html>