Can someone please tell me why my script wont go to the 2th question?
i have checked the firefox console it does not show any syntactical errors so I’m kind of stuck here.
thank you in advance.
here is my script:
<head>
<script type="text/javascript" >
var vraag = new Array();
var cantwoord = new Array();
vraag[1] = "8x4=? ";
vraag[2] = "8/4=? ";
vraag[3] = "16x4=? ";
cantwoord[1]= "32";
cantwoord[2]= "2";
cantwoord[3]= "64";
function toets(index)
{
antwoord = prompt(vraag[index]);
if(antwoord == cantwoord[index])
{
return ("Correct");
}
else
{
return ("Fout");
}
}
</script>
</head>
<body>
<script type="text/javascript">
//<![CDATA[
var doorgaan = true;
var index = 0;
while(doorgaan)
{
index++;
resultaat = toets(index);
doorgaan = confirm(reultaat+" Wil je doorgaan ?");
if(index==3) break;
}
//]]>
</script>
</body>
Do these modifications: