The idea behind minesweeper is to find all the mines in the minefield without hitting one. When a square is selected, the square will revile how many mines are next to it--including diagonals. Use this information to determine which other locations to try.
Changing to "mark-mode" will allow cells you suspect to contain a mine to be marked. This will denote there is a mine in the cell and prevent you from accidentally hitting the cell.
The game is time-based and aside from clearing the mine field, you can try to improve your times at the various difficulties.
JavaScript Minesweeper is is free, open-source software released under the GNU license.
This version of Minesweeper was written by Andrew Que
(C) Copyright 2007 by Andrew Que