0

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 1

2

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]);
Sign up to request clarification or add additional context in comments.

1 Comment

Presumably in the displayScore function.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.