You can create three message boxes in javascript: Warning box, confirmation box, and prompt box.
Instance
-
Warning box
-
Warning box with lines
-
Confirmation box
-
Prompt box
Warning box
The warning box is often used to ensure that users can obtain certain information.
When a warning box appears, you must click OK to continue the operation.
Syntax:
Alert ("text ")
Confirmation box
The confirmation box enables users to verify or accept certain information.
After the confirmation box appears, you must click OK or cancel to continue the operation.
If you click OK, the return value is true. If you click Cancel, the returned value is false.
Syntax:
Confirm ("text ")
Prompt box
The prompt box is often used to prompt users to enter a value before entering the page.
When the prompt box appears, you need to enter a value and click "OK" or "cancel" to continue the operation.
If you click OK, the returned value is the input value. If you click Cancel, the return value is null.
Syntax:
Prompt ("text", "default ")