title: How do I ask a user if they want to play the game again?
body: <p>I want to ask the user if they want to play the game again at the end only if they guess correctly. If they say no I want to end the program. So basically yes-> play again and no->end program</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;NumberGuesser&lt;/title&gt;
  &lt;script&gt;
  
  var guess = 99;
  var target = 0;
  var turns = 0;
  var msg = "";
  
  target = Math.floor(Math.random() * 100) + 1;
  alert (target);
  
  msg = "Guess my number between 1 and 100 !. \n";
  msg += "Guess the number, and I'll tell you if it's too high, \n";
  msg += "too low, or correct. ";
  alert (msg);
  
  guess = eval(prompt("What is your guess?", ""));
  
  while ( guess != target){
    if (guess &gt; target){
  guess = prompt (turns + ".  Too high!! Try again!!", "");
    } // end if
  
    if (guess &lt; target){
      guess = prompt (turns + ".  Too low!! Try again!!", "");
    } // end if
  
    if (guess == target){
      msg = "YOU WIN!!! \n";
      alert (msg);
    } // end if
  } // end while
  
  &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;center&gt;&lt;center&gt;
  &lt;h1&gt;NumberGuesser&lt;br&gt;&lt;/h1&gt;
  &lt;/center&gt;
  &lt;hr&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Thanks guys, I'm having a rough time in javascript.</p>