January 2001
Beginner
312 pages
6h 4m
English
The prompt() method is a little different from the other two you have looked at in the course of this chapter. This is the only one that either allows the user to type in his own response to the question, instead of the script just processing information it already has (as with the alert() method), or allows the user to choose OK or Cancel (available using the confirm() method).
You add the prompt() method in much the same way as the other two. To begin with, add the prompt() method to the <script> block:
<html> <head> <title>A Simple Page</title> <script language="JavaScript"> <!-- Cloaking device on! prompt(); // Cloaking device off --> </script> </head> <body> </body> </html>
The prompt() method now starts to differ ...
Read now
Unlock full access