From 2f01457ede0199333ea460e8fe3d165e49a0fd63 Mon Sep 17 00:00:00 2001 From: Sarah <sarah.fiedler@rbb-online.de> Date: Tue, 11 Mar 2025 15:09:59 +0100 Subject: [PATCH] add EventListener --- game/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/game/index.js b/game/index.js index b4badeb..fa6eec5 100644 --- a/game/index.js +++ b/game/index.js @@ -9,6 +9,10 @@ const roundResultsMessage = document.getElementById("results-msg") const buttonStein = document.getElementById("rock-btn") const buttonPapier = document.getElementById("paper-btn") const buttonSchere = document.getElementById("scissors-btn") +buttonStein.addEventListener("click", showResults("Stein")); +buttonPapier.addEventListener("click", showResults("Papier")); +buttonSchere.addEventListener("click", showResults("Schere")); + function getRandomComputerResult(){ const number = Math.floor(Math.random()*options.length); -- GitLab