I have created a check box within a div and I want to make it so that when the check box is checked the div changes it's background colour with a fade. any suggestions? Thanks.
1 Answer
One simple way:
if (numCorrect == 0) {
score.append("You are stoopid");
} else if (numCorrect == 1) {
score.append("You are pretty dumb");
} else if (numCorrect == 2) {
...
Another possibility would be to use an array of responses indexed by numCorrect.
var sayings = [ "You are stoopid", "You are pretty dumb", ... ];
score.append(sayings[numCorrect]);
1 Comment
John Hascall
Presumably in the
displayScore function.