I'm pretty new the programming and I'm trying to make Rock paper scissors using Javascript and I ran into this problem. Whenever I click the rock Image, it is supposed to generate a random number between 0 and 2 and if the number is 0, it's a tie, if it's 1, the player loses and if it's 2 the player wins. But when I run this code it only works if the number is 0. So when I click the button, if the number is 0 it shows 'its a tie' but if it isn't 0 it does not show anything. But when I try clicking again, it does not work. I have to refresh the page to try again. Can someone help me, sorry if I didn't explain this properly.

HTML:

```

<html>
    <head>
        <link rel="stylesheet" href="style.css">
        <link rel="preconnect" href="https://fonts.gstatic.com">
        <link href="https://fonts.googleapis.com/css2?family=Ubuntu&display=swap" rel="stylesheet">

    </head>
    <title> Rock Paper Scissors! </title>
    <body>
        <div id="rpsGame">
        <h1 id="RPS"> Rock, paper, scissors! </h1>
          <div id="score">
        <p id="myScore">0</p>
        <p>:</p>
        <p id="botScore">0</p>
          </div>
        <img src="rock.png" id="rock">
        <img src="paper.png" id="paper">
        <img src="scissors.png" id="scissors">
        <p id="winOrLose"></p>
        </div>
    </body>
</html> 

```

Javascript:

```

   var randomNumber = Math.floor(Math.random() * 3)
            var rockChoice = document.getElementById('rock');
            var botAnswer = document.getElementById('winOrLose')

         rockChoice.addEventListener('click', function() {
             if (randomNumber == 0) {
                 botAnswer.textContent = "Bot picked rock, you tie!"

               if (randomNumber == 1) {
                  botAnswer.textContent = "Bot picked paper, you lose!"

            if (randomNumber == 2) {
                  botAnswer.textContent = "Bot picked scissors, you lose!"
             }
         }
    }
         });

```

CSS:

```

body {
    background-color:#2a303d;
    text-align: center;
    font-family: 'Ubuntu', sans-serif;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -o-user-select: none;
    user-select: none;
}

#rock {
    width: 80%;
    position: absolute;
    top: 45.8%;
    left: 39.75%;
    transform: translate(-50%, -50%);
    transform: rotate(360deg);
    height: 100px;
    width: 100px
}

#paper {
    width: 80%;
    position: absolute;
    top: 45.8%;
    left: 46.75%;
    transform: translate(-50%, -50%);
    transform: rotate(360deg);
    height: 100px;
    width: 100px;
}

#scissors {
    width: 80%;
    position: absolute;
    top: 52.05%;
    left: 57.25%;
    transform: translate(-50%, -50%); 
    height: 100px;
    width: 100px;
}

#RPS {
    font-size: 65px;
    margin-top: 40px;
}

#botPick {
    font-size: 50px;
    margin-top: 350px;
}

#Score p {
    margin:0;
    padding:0;
    margin-left: 5px;
    font-size: 36px;
    display: inline-block;
    line-height: 80px;
    vertical-align: top;
}

#winOrLose {
    color: white;
}

```