Alert, Prompt, Confirm part 1

Alert, Prompt, Confirm
4
1/3













The Alert Box
JavaScript offers three types of popup boxes, the Alert, Prompt, and Confirm boxes.
Alert Box
An alert box is used when you want to ensure that information gets through to the user.
When an alert box pops up, the user must click OK to proceed.
The alert function takes a single parameter, which is the text displayed in the popup box.
Example:
Result:
To display line breaks within a popup box, use a backslash followed by the character n.
Result:
Be careful when using alert boxes, as the user can continue using the page only after clicking OK.
Comments
Post a Comment