/jQuery-guessing-game

(Star Trek episode or nail polish colour?)

Primary LanguageJavaScript

jQuery-guessing-game

#The basics

This is a script that presents the user with something and makes him/her guess whether it belongs to one category or another. (Think Mental Floss quizzes).

##Components

  • index.html: Structure + any content outside of the actual quiz (intro, footer, what have you).
  • style.css: All the pretty goes in here.
  • init.js: Main quiz content + interactivity.

index.html

The HTML relating to the actual quiz begins on line 22 here. Change only the IDs for the two buttons and the text within them.

The rest of the document can be formatted however you like.

style.css

Go ape.

init.js

Store your data in object format. The bare minimum is a name and a one-word "type" ID that will reflect one possibility or the other. Designate a more complete type description (for full sentences) further down in the code (line 63 in this release). You'll need to add conditions here if you have more than one type.

The file itself is thoroughly commented with instructions.

Done.