Hello i am working on playing with some while loops in Dreamweaver. Its a number game where you have to guess the secret number which is 4. If you guess incorrect a prompt should be executed so you can guess again. My problem is the first prompt only executes and regardless of the number inserted nothing happens. I tried putting this code all in one script tag nothing prompts. What am i doing wrong? <script> var secretnumber = 4; var guess = prompt("Guess a number"); </script> <script> while(Number(guess)!==="4") { prompt("incorrect try again"); } </script> <script> if(Number(guess)==="4") {alert("you are correct")} </script>
... View more