1. Home
  2. Computing & Technology
  3. JavaScript

Related Image Match Game

2. Get the Script

More of this Feature

Introduction

The script for this game is in three parts. The first two part go in the head section of your web page. The first step is to select the code from the text box below (there is a highlight all button beneath it to make this easier) and copy it into a file called memorymu.js.

Note the way the array containing all the images is arranged with an array of fifteen arrays each of two images. The two images in each of the arrays within the main array are considered to match one another for the purpose of the game.

Next select the code from the text box below and copy it into a file called memoryi.css.

You next attach these into the head section of your page.

<script type="text/javascript" src="memorymu.js">
</script>
<link rel="stylesheet" href="memoryi.css" type="text/css" />

Now all that remains is to add the following HTML into the body of your page where you want the game to appear.

<div id="memory"></div>
Explore JavaScript
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. JavaScript

©2009 About.com, a part of The New York Times Company.

All rights reserved.