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>

javascript7A.gif (2214 bytes)

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>

javascript7B.gif (2457 bytes)

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>

javascript7C.gif (2596 bytes)

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 - MenuNext ->