title: Guessing Game in Javascript
body: <p>What I'm trying to do is make a simple guessing game where the user can any the number without limit but will be graded at the end when the guessed the number correctly based on the number of their guesses. However, with my code when I enter a number and press the button to multiple times the hint changes from "Higher" to "Lower" even if the number is not changed also the message that should be displayed when the number is guessed correctly is not showing. Here's my code, I'm a beginner so there's bound to be errors in the code and any help is appreciated.</p>
  
  <pre><code>&lt;fieldset&gt;
      &lt;input type="number" id="guess" /&gt;
      &lt;button onClick="checknum();"&gt;Check Number&lt;/button&gt;
  &lt;/fieldset&gt;
  
  &lt;fieldset&gt;  
      &lt;p&gt;Your current status:&lt;/p&gt;
      &lt;output id="status_output"&gt;You have yet to guess anything.&lt;/output&gt;
  &lt;/fieldset&gt; 
  
  &lt;script type="text/javascript"&gt;
  
      function checknum(){
  
          var randomNumber = Math.floor((Math.random() * 100) + 1);
          var guessNumber = document.getElementById("guess").value;
          //var guessNumber = parseInt(guess.value);
          var statusOutput = document.getElementById('status_output');
          var counter = 0;    
          var isguessed = false;
  
          do {
              counter = (counter + 1)
              if (guessNumber &lt; randomNumber) {
                  statusOutput.value = ("Higher");
              }
              else if (guessNumber &gt; randomNumber) {
                  statusOutput.value = ("Lower");
              }
              else if (guessNumber = randomNumber) {
                  set (isguessed = true());
                  statusOutput.value = ("Correct" + mark());
              }
          }
          while (isguessed = false);
      }
  
      function mark(){
          if (counter &lt; 10){
              statusOutput.value("Excellent");
          }
          else if (counter &gt; 10 &amp;&amp; counter &lt;20){
              statusOutput.value("Okay");
          }
          else 
              statusOutput.value("Needs Practice");
      }
  
  &lt;/script&gt;
  </code></pre>