Image 15-Puzzle mechanics

The HTML Document

Firstly, we'll create a HTML Document with a reference to our external Javascript file in the head (which we'll call image-puzzle-game.js), and a Canvas element in the Body, with a width and height of 400 and 300 pixels respectively and the id game:

<!DOCTYPE html>
<html>
<head>

<script type="text/javascript" src="image-puzzle-game.js"></script>

</head>
<body>

<canvas id="game" width="400" height="300"></canvas>

</body>
</html>
Page loaded in 0.027 second(s).