()
| 59 | |
| 60 | // ** Make the RPS buttons actively listen for a click and do something once a click is detected ** |
| 61 | function playGame() { |
| 62 | // use querySelector to select all RPS Buttons |
| 63 | const selection = document.querySelectorAll('.rpsButton') |
| 64 | |
| 65 | selection.forEach(clickks =>{ |
| 66 | clickks.onclick = () => onClickRPS(clickks) |
| 67 | }) |
| 68 | |
| 69 | |
| 70 | // Add a click listener to the end game button that runs the endGame() function on click |
| 71 | let endGameButton = document.getElementById('endGameButton') |
| 72 | endGameButton.onclick = () => endGame() |
| 73 | } |
| 74 | |
| 75 | // ** endGame function clears all the text on the DOM ** |
| 76 | function endGame() { |
no test coverage detected