Guess a number - java script and html


Question:

Guess a Number - Java Script and HTML

Write a HTML script that plays a "guess the number" game as follows.

The program chooses the number to be guessed by selecting a random integer in the range of 1 to 1000. The script displays the prompt "Guess a number between 1 and 1000" next to a text field. The player types a guess into the text field and clicks a button to submit the guess to the script. If the player's guess is incorrect, the program should display "Too high. Try again." or "Too low. Try again." to help the player "zero in" on the correct answer, and should clear the text field so that the user can enter the next guess. When the user enters the correct answer, display "Congratulations. You guessed the number!" and clear the text field so the user can play again.

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Guess a number - java script and html
Reference No:- TGS01937756

Now Priced at $20 (50% Discount)

Recommended (94%)

Rated (4.6/5)