title: Event listener in my button doesn't work properly, the function runs normally outside the click event, but it doesn't work when I click the button
body: <p>I am making a rock,paper and scissors game.</p>
  
  <p>This is my whole code, I am only posting it full because I can't figure out why it isn't working, when I use  <code>playRound('paper','scissors');</code> the function runs just fine, but when I use it inside a click event such as (see the end of the code) :</p>
  
  <pre><code>var paperButton = document.querySelector("#paper");
  paperButton.addEventListener("click", playRound('paper',computerPlay()));
  </code></pre>
  
  <p>it just doesn't work, I click the paper button but it doesn't do anything. Why?</p>
  
  <pre><code> &lt;!DOCTYPE html&gt;
      &lt;html lang="en"&gt;
      &lt;head&gt;
  
        &lt;meta charset="UTF-8"&gt;
        &lt;title&gt;Rock, Paper and Scissors Game&lt;/title&gt;
        &lt;link rel="stylesheet" type="text/css" href="style.css"&gt;
      &lt;/head&gt;
      &lt;body&gt;
  
      &lt;div class="container"&gt;
        &lt;button id="rock"&gt;Rock&lt;/button&gt;
        &lt;button id="paper"&gt;Paper&lt;/button&gt;
        &lt;button id="scissors"&gt;Scissors&lt;/button&gt;
      &lt;/div&gt;
  
      &lt;div class="results"&gt;
        &lt;div id="result"&gt;No result&lt;/div&gt;
  
      &lt;/div&gt;
  
      // HTML ENDS HERE
  
  
      //START OF THE JAVASCRIPT 
      &lt;script&gt;
  
      var computerScore = 0; 
      var playerScore = 0;
  
      function computerPlay(){
  
          let randomNum = Math.floor((Math.random() * 3) + 1);  
  
          if (randomNum == 1) {
             var compChoice = 'rock';
          } else if (randomNum == 2){
              var compChoice = 'paper';
          } else {
             var compChoice = 'scissors';
          }
  
          return compChoice;
      }
  
  
      function playerPlay() {
  
          var playerChoice = prompt("Enter rock, paper or scissors");
          return playerChoice;
  
      }  
  
      function playRound(playerSelection, computerMove ) {
  
      var result = document.querySelector("#result");
  
  
        switch(playerSelection) {
  
          case 'rock':
  
            if (computerMove === 'paper') {
              computerScore++;  
              result.textContent = 'Paper beats rock! You lose that round.';
  
            }
            else if (computerMove === 'scissors') {
                playerScore++;
               result.textContent = 'Rock beats scissors! You win that round.';
  
            }
            else {
               result.textContent = 'It\'s a draw!';
            }
            break;
          case 'paper':
            if (computerMove === 'scissors') {
                computerScore++;
               result.textContent = 'Scissors beats paper! You lose that round.';
  
            }
            else if (computerMove === 'rock') {
                playerScore++;
               result.textContent = 'Paper beats rock! You win that round.';
  
            }
            else {
               result.textContent = 'It\'s a draw!';
            }
            break;
          case 'scissors':
            if (computerMove === 'rock') {
                 computerScore++;
               result.textContent = 'Rock beats scissors! You lose that round.';
  
            }
            else if (computerMove === 'paper') {
                playerScore++;
               result.textContent = 'Scissors beats paper! You win that round.';
  
            }
            else {
               result.textContent = 'It\'s a draw!';
            }
  
  
        }
  
      }
  
      playRound('paper','scissors');  //this works
  
      var rockButton = document.querySelector('#rock');
      rockButton.addEventListener("click", playRound('rock',computerPlay())); // doesn't work
  
      var paperButton = document.querySelector("#paper");
      paperButton.addEventListener("click", playRound('paper',computerPlay())); // doesn't work
  
      var scissorsButton = document.querySelector("#scissors");
      scissorsButton.addEventListener("click", playRound('scissors', computerPlay())); // doesn't work**
  
  
  
  
      &lt;/script&gt;       
  
      &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>