diff --git a/script.js b/script.js index 343e12b..6d41d91 100644 --- a/script.js +++ b/script.js @@ -89,10 +89,17 @@ function game() { function endGame(){ let winner = (pScore > cScore) ? true : false; + const newGame = document.createElement("button"); + const newDiv = document.createElement("div"); if (winner) { msg.textContent = "You won the game! Great job!"; } else { msg.textContent = "You lost the game. Better luck next time!"; } + + newGame.textContent = "Play Again?"; + newGame.classList.add("button"); + newDiv.appendChild(newGame); + msg.appendChild(newDiv); } \ No newline at end of file diff --git a/style.css b/style.css index 96402cf..bf3d9dc 100644 --- a/style.css +++ b/style.css @@ -17,7 +17,7 @@ h1{ justify-content: center; } -.button { +.button, #msg .button { width: 200px; margin: 5px; font-size: 30px;