This is a simple and interactive Tic Tac Toe game built using HTML, CSS, and JavaScript. The game allows two players to play against each other, taking turns to mark X or O on a 3x3 grid. The first player to align three of their marks horizontally, vertically, or diagonally wins the game.
- HTML5
- CSS3
- JavaScript
- Interactive 3x3 grid for gameplay.
- Dynamic turn switching between
XandO. - Display of the current player's turn.
- Reset button to start a new game.
- Winning line animation when a player wins.
- Sound effects for game actions (turn change and game over).
- Simple and responsive design.
index.html: The main HTML structure of the game.style.css: The stylesheet for styling the game.script.js: The JavaScript file containing game logic.bg.jpg: Background image for the game.cheer-happy.gif: Animation displayed when a player wins.music.mp3,ting.mp3,gameover.mp3: Audio files for background music, turn change, and game over.
- Open the
index.htmlfile in a web browser. - The game starts with player
X. The current player's turn is displayed at the top. - Click on any empty box in the grid to place your mark.
- The turn will automatically switch to the other player (
OorX) after each move. - The game checks for a winning combination after every move. If a player wins, the winning line is displayed, and a congratulatory animation is shown.
- Click the "Reset" button to start a new game.
- The game alternates turns between player
Xand playerO. - A player wins by aligning three of their marks in a row, column, or diagonal.
- The game is reset when the "Reset" button is clicked.
No installation is required. Simply download the files and open index.html in any modern web browser to play.


