08. Dom Traversal πŸ‘©β€πŸŽ“πŸ‘¨β€πŸŽ“

πŸ“– Implement Tic-Tac-Toe Automation

Work with a partner to implement the following user story:

  • As a game developer, I want to programmatically change the board style.

  • As a game developer, I want to programmatically add the winning move.

Acceptance Criteria

  • It’s done when the board’s tiles are automatically styled on page load.

  • It’s done when the X player is blocked from winning.

  • It’s done when the O player has won.

πŸ“ Notes

Refer to the following documentation:

jQuery Docs on Traversing

jQuery Docs on Markup Changes

Assets

The following image demonstrates the web application’s appearance and functionality:

A Tic-Tac-Toe board shows that the O player has won the game.


πŸ’‘ Hint

  • The starting point for all the the traversals in this activity must begin at the <main id="root">, which has been assigned for you as rootEl.

πŸ† Bonus

If you have completed the activity and want to further your knowledge, work through the following challenge with your partner:

  • What are some alternative methods to traverse up and down the DOM tree? Use Google or another search engine to answer this question.

βœ… Solutions

Solutions Click Here