How to Make a Basic JavaScript Quiz

Part 1 of 5:

Setting Up

  1. How to Make a Basic JavaScript Quiz Picture 1
    Set up your programming environment. You will need a text editing program to write your code in. You can write it in a notepad document but you will probably want an editor designed for programming such as Notepad++ (Windows), Atom (Mac) or Notepad (Linux). However any basic text editor does work.
  2. How to Make a Basic JavaScript Quiz Picture 2
    Create the files you need. You will need two files: one in HTML that is read by the browser and one in JavaScript that is the game.
  3. How to Make a Basic JavaScript Quiz Picture 3
    Set up your files and folders. Because you only need two files, you don't need any sort of complex filing system. As long as the two files are in the same level of the same folder it will work. So save both of your files in the same place.
    1. To save as html add a .html extension. Us a .js extension for the JavaScript file.Set up code in your files. The JavaScript file requires no setting up but the HTML does. In your HTML document add the following code:
       <html> <head> <title>Page Nametitle> <script src="quiz.js">script> head> <body> body> html> 
    2. This is the basic set up for almost any page in HTML.
      1. defines the code as HTML to the browser.
      2. tells the browser that everything in that section is written in HTML unless specified otherwise.
      3. is a section that holds information about the page such as the title.
      4. is the name that shows up in search results and the name on the tab.
5 ★ | 1 Vote

May be interested

  • How to Make a JavaScript Image RolloverPhoto of How to Make a JavaScript Image Rollover
    javascript is the most popular lightweight scripting language which works in the major browsers such as internet explorer, chrome, safari, firefox, and opera. it is also easy to use to build a dynamic and interactive website. one of its...
  • How to Create a Javascript Console in Sublime TextPhoto of How to Create a Javascript Console in Sublime Text
    javascript consoles are very handy for debugging and getting live results from your script. although sublime text comes with build systems for many other scripting languages, it does not come with a built-in javascript build system. many...
  • How to Enable WebglPhoto of How to Enable Webgl
    this tipsmake teaches you how to enable webgl. webgl (web graphics library) is a javascript api that is used to render 2d and 3d graphics within a compatible web browser. open google chrome . it has an icon that resembles a red, yellow, and...
  • How to Use JavaScript InjectionsPhoto of How to Use JavaScript Injections
    javascript injection is a process by which we can insert and use our own javascript code in a page, either by entering the code into the address bar, or by finding an xss vulnerability in a website. note that the changes can only be seen...
  • How to Enable JavaScriptPhoto of How to Enable JavaScript
    this wikihow teaches you how to turn on your computer browser's javascript, which allows your browser to load and view certain elements--such as videos or animations--on some web pages. you can enable javascript using chrome on desktop and...
  • How to Disable JavaScriptPhoto of How to Disable JavaScript
    this wikihow teaches you how to turn off your web browser's javascript support. javascript is responsible for loading dynamic content in webpages, so turning it off can help websites load faster than usual. most web browsers and their...