I have to make a connect four style game for a course I am doing.
At the moment when a player clicks a square on the grid, it fills that square with either an X or a O depending on which player has been assigned what.
The final thing I need to do is have the grid square display and image (either red or green) in the square instead of the text. This is the small section of the code that is displaying the text of either X or 0 which I need to somehow change to display an image instead. This is part of a wider onClick function which happens whenever a player clicks on a grid square.
if (turn == player1Name) {
moveCount++;
$(this).text("0");
grid[row][col] = 1;
var ifWon = winnerCheck(1,player1Name);
}