title: Why is this condition not working properly?
body: <p>I have to make a number guessing game where you have three tries to guess a number between 1 and 5. After each wrong guess, it shows you how many tries you have left. When you guess it correct, you get a congratulations message. When you run out of guesses you get a message. However, I can't get the message for when you run out of guesses to run. Why does it not run?</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      var tries=3;
      alert("Guess the number I'm thinking of between 1 and 5. You've got 3  tries.");
      var attempt =  prompt(tries+" tries remaining. Enter your guess.");
      var randomnumber = Math.random() * 5; 
      randomnumber = Math.ceil(randomnumber);
      while (tries&gt;=2){
          if(attempt!=randomnumber){
              tries--;
              prompt("Wrong! You have " + tries + " left ");
          }
          else if(tries&lt;1){
              alert("You have no tries left");
          }
          else {
              alert("Congratulations! You guessed the correct number");
              return;
          }
      }
  &lt;/script&gt;
  </code></pre>