Purchase Solution

Guess a Number - Java Script and HTML

Not what you're looking for?

Ask Custom Question

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.

Purchase this Solution

Solution Summary

This solution includes Java Script code in conjunction with HTML. The Java Script code deals with random number generation. The user guesses a number between 1 and 1000. If the player's guess matches the random number generated by script, an appropriate message is displayed. However, if the user's guess is less than the number generated, then accordingly another message is displayed.

Purchase this Solution


Free BrainMass Quizzes
Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.

C++ Operators

This quiz tests a student's knowledge about C++ operators.

Basic Networking Questions

This quiz consists of some basic networking questions.