G-Bomb
Joined: 29 Feb 2004 Posts: 73
|
Posted: Thu Mar 04, 2004 8:28 pm Post subject: JavaScript Prompt |
|
|
Using the prompt command, you can get information from the user to use however you wish.
Try this sample code:
| Code: | <HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript"><!--
var name=prompt("Welcome! What is your name?","Enter your name here.");
// --></SCRIPT>
</HEAD>
<BODY>
<SCRIPT LANGUAGE="JavaScript"><!--
document.write("This, " + name + ", is how to use the prompt command.");
// --></SCRIPT>
</BODY>
</HTML> |
This will bring up a prompt asking for you to enter your name. That is then saved in a variable and printed on the screen. |
|