|
Re: tic tac toe help
I'd suggest using an HTML table with 3x3 cells. Set one of three possible images inside each cell (E.G. "X.jpg", "O.jpg", "Empty.jpg"). And give each cell's image a unique ID attribute (E.G. "topleft", "topmiddle", "topright", etc...).
Then whenever you need to change the pieces, simply use Javascript to dynamically modify the "src" attribute of the image. For example, if the user sets an "X" in the top-left cell, change the "src" attribute of the element with the ID "topleft" to "X.jpg".
|