alert method (window)
Displays an alert window with the specified message and an OK button.
This method makes it possible to notify the user about important information.
Script execution does not continue until the alert method returns (the user presses the OK button or closes the alert window).
Note: when the alert method is invoked for an object, it displays the string returned by the toString method of the object.
Syntax:
You can find the related objects in the Supported by objects section below.
Parameters:
Optional. String that specifies the text for the message in the dialog box. Default is an empty string. This parameter is required in Firefox. |
Return value:
This method has no return value.
Example HTML code 1:
This example illustrates the use of the alert method.
|
||||
<head> <script type="text/javascript"> function Notify () { alert ("The operation was successful!"); } </script> </head> <body> <button onclick="Notify ()">Create an alert window</button> </body> |
||||
|
||||
Did you find this example helpful?
|
Supported by objects:
Related pages:
External links:
User Contributed Comments