Alert, Confirm and Prompt Methods
These approaches to 'output' are less flexible than using Forms,
but they have their use (particularly the "Prompt" method).
| HTML/JavaScript Code |
Result |
| ALERT: <BODY>
Using an Alert box.
<BR>
<FORM NAME = "DemoAlert">
<BR>
<INPUT TYPE = "button" VALUE = "This is an Alert ..."
onClick = "window.alert('This is a test ...');">
</FORM>
</BODY> |

|
| CONFIRM: <BODY>
Using an Confirm box.
<BR>
<FORM NAME = "DemoConfirm">
<BR>
<INPUT TYPE = "button" VALUE = "This is a Confirm box ..."
onClick = "window.confirm('This is a test ...');">
</FORM>
</BODY> |

|
| PROMPT: <BODY>
Using a Prompt Dialogue box.
<BR>
<FORM NAME = "DemoPrompt">
<INPUT TYPE = "button" VALUE="This is a Prompt box ..."
onClick="var temp = window.prompt('This is a test ...','Default');">
</FORM>
</BODY> |

|
NOTE: In the case of the Prompt method, the
variable "temp" will contain the text, or number entered by the
user. This value is available for use by other JavaScript.
<- Back - Menu
- Next ->