Gaining input from the user is a fairly trivial task -- many of the examples thus far have used the prompt method to gain user input.

This section of code basically uses the same formula to prompt the user for input 3 times (once for each colour). The main consideration here is usability. Therefore, there has to be an easy way to exit (by typing 'quit'). It is also a good idea to check to see if the user has pressed the cancel button by checking for the null value (although this won't work for Microsoft browsers before version 4.0).

This is not an exciting script by any means, but it is necessary to the functionality of the final script, so it must be checked to see that it's functioning correctly.

Close Window