HTML and CSS Reference
In-Depth Information
Code
Explanation
document.f.score.value = String
(1+Number(document.f.score.value));
Increment the score (need to change value to number,
add 1, and then change back to text)
}
Close if match true clause
else {
Else
document.f.out.value = "WRONG";}
Output the value
WRONG
}
Close
else
clause
else {
If it wasn't a second click
makingmove = true;
Check
makingmove
elementinmotion = this;
Save
this
element in the
elementinmotion
variable
}
End
else
clause
}
End
pickelement
</script>
End
script
</head>
End
head
<body onLoad="init();">
Start body tag. Set up call to
init
on loading.
<h1>G20 Countries and
capitals </h1><br/>
Heading on the screen
Click on country or capital
and then click on corresponding
capital or country.
Directions
<p>
Paragraph
Reload for new game.
Directions
<form name="f" >
Start of form
Action: <input name="out" type=
"text" value="RIGHT OR WRONG"/>
Text label and then input field