@hqz3
Posted
Hello, regarding your question about how to continue playing the game without reloading the webpage, if I'm reading your code correctly, there is a game-body
element and a selection
element. You hide the game-body
when the user makes a choice and then show the selection
. So when the user chooses to play again, you have use JS to hide the selection
element and show the game-body
element.
A heuristic for creating these elements is to treat them as modular blocks that you can either show or hide using CSS or simply attach or remove from the DOM using JavaScript.
Marked as helpful