I am a student and am completing a series of different programs to pass my unit
it is open book and one of the programs i am creating is to have a quiz in which the user answers 3 questions (what is the capitals of spain,scotland and france) now i have a basic program ready but it wont run and i have no idea why can anybody help.
here is my code so far:
<html>
<head>
<script type=”text/javascript”>
function show_prompt()
{
var qfrance=prompt(‘What is the capital of France’);
if( qfrance !== “Paris”);
for (i = 1 ; i <=1; i++){
window.alert(“that is incorrect!”);
prompt(‘try again What is the capital of France’);
}
{
var qspain=prompt(‘What is the capital of Spain’);
if( qspain !== “Madrid”);
for (i = 1 ; i <=1; i++){
window.alert(“that is incorrect!”);
prompt(‘ try again What is the capital of Spain’);
}
{
var qscotland=prompt(‘What is the capital of Scotland’);
if( qscotland !== “Edinburgh”)
for (i = 1 ; i <=1; i++){
window.alert(“that is incorrect!”);
prompt(‘ try again What is the capital of France’);
}
window.onload=show_Prompt();
</script>
</head>
</html>
please help thanks