Build a Rock, Paper, Scissors Game - Step 10

Tell us what’s happening:

I am stuck on step 10. It says to add an event listener to three buttons and call function show results. I wrote code for all three buttons but its not passing the test. Please help me finding my mistake. Thank you

Your code so far

<!-- file: index.html -->

/* file: styles.css */

/* file: script.js */
// User Editable Region



rockBtn.addEventListener("click", showResults("Rock"));
paperBtn.addEventListener("click", showResults("Paper"));
scissorsBtn.addEventListener("click", showResults("Scissors"));



// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36

Challenge Information:

Build a Rock, Paper, Scissors Game - Step 10

Welcome to the forum @Anmol75085

When I click on the buttons nothing happens.
Something is missing from the event handler.

Happy coding

when you write this, you are calling the function showResults when the event listener is created, not when the button is clicked

you need to pass a function as second argument, in this case you are passing the output of the function

I got it now . Thanks for helping