A script for Trivia created with JavaScript. The quizzes (questions and answers) are stored in external files, in XML or JSON format.
The Trivia Game has two levels:
  • Level 1 - displays a list of answers to each quiz, and the user must click on the correct answer.
  • Level 2 - is a little more difficult. The last letter from the possible answers is deleted. It is displayed a text box in which the user can write the answer.
It has two modes:
  • Consecutive - the quiestions start from the quiz with index number added into a text field, and are displayed in their order till the last quiz.
  • Random - the quizzes are choosed randomly, till the last quiz, without repeat.
Also, the user can choose to play the trivia with a Countdown Timer (15 seconds to answer till the script adds automatically the correct answer).
You can easily add quizzes and multiple categories in this Trivia script, the quizzes of each category are stored in its external file (more informations are in 'readme.html' file in the archive with this script).


• To Download this script, click: Trivia Game Script.

Demo Trivia

Welcome to Trivia Game

- Choose the set of questions from the "Trivia Category".
- Click the Start button to start the quizzes.
-The Reset button resets the Trivia.

Levels:
  • Level 1 - Easy - It is displayed a list of answers to each quiz. Click the correct answer.
  • Level 2 - Difficult - You write the answer into a text field, then click on Send button. The last letter from the possible answers is deleted.
Mode
  • Consecutive - The quiestions start from the quiz with index number added into a text field, and are added in their order till the last quiz.
  • Random - The quizzes are choosed randomly, till the last quiz, without repeat.
- Countdown Timer - If that button is checked, you have 15 seconds to answer till the correct answer is added automatically.
Trivia Category

Mode


From to

Quizzes: 0 of

0 - Correct
0 - Incorrect

Daily Test with Code Example

HTML
CSS
JavaScript
PHP-MySQL
Click on the HTML tag which creates an horizontal line in web page.
<br /> <em> <hr />
Some content ...
<hr />
Content under line ...
Which CSS property defines the text color?
font-style font-variant color
h2 {
  color: #cbdafb;
}
Click on the function which searches if a character, or text exists in a string.
indexOf() toString() split()
var str = "Web courses - http://CoursesWeb.net/";
if(str.indexOf("http://") == -1) alert("http:// isn`t in string");
else alert("http:// is in string");
Which function splits a string into an array of strings based on a separator?
array_merge() explode() implode()
$str = "apple,banana,melon,pear";
$arr = explode(",", $str);
var_export($arr);      // array (0=>"apple", 1=>"banana", 2=>"melon", 3=>"pear")
JavaScript Trivia Game

Last accessed pages

  1. Sending Email, Mailables (240)
  2. Define Custom List-item Markers, Bullets for UL, OL Lists (3680)
  3. SHA256 Encrypt hash in JavaScript (7023)
  4. Input text fields (2285)
  5. Insert, Select and Update NULL value in MySQL (30219)

Popular pages this month

  1. Insert, Select and Update NULL value in MySQL (515)
  2. Read Excel file data in PHP - PhpExcelReader (430)
  3. PhpSpreadsheet - Read, Write Excel and LibreOffice Calc files (319)
  4. PHP getElementById and getElementsByTagName (255)
  5. Courses Web: PHP-MySQL JavaScript Node.js Ajax HTML CSS (234)