MCPcopy Create free account
hub / github.com/codemistic/Web-Development / playGame

Function playGame

Rock-Paper-Scissors-Game/script.js:61–73  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

59
60// ** Make the RPS buttons actively listen for a click and do something once a click is detected **
61function playGame() {
62 // use querySelector to select all RPS Buttons
63 const selection = document.querySelectorAll('.rpsButton')
64
65selection.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 **
76function endGame() {

Callers 1

script.jsFile · 0.85

Calls 2

onClickRPSFunction · 0.85
endGameFunction · 0.70

Tested by

no test coverage detected