1. Warning box
The warning box is often used to ensure that users can get certain information.
When the warning box appears, the user needs to click the OK button to continue the operation.
grammar:
Copy code code as follows:
Alert ("Text")
2. Confirmation box
The confirmation box is used to verify or accept certain information.
When the confirmation box appears, the user needs to click the OK or cancel button to continue the operation.
If the user clicks to confirm, the return value is true. If the user clicks to cancel, the return value is false.
grammar:
Copy code code as follows:
Confirm ("Text")
3. Speed box
The prompt box is often used to prompt users to enter a certain value before entering the page.
When the prompt box appears, the user needs to enter a certain value, and then click the confirmation or cancel button to continue manipulating.
If the user clicks confirmation, the return value is the input value. If the user clicks to cancel, the return value is null.
grammar:
Copy code code as follows:
Prompt ("text", "default value")
Example:
Copy code code as follows:
<html>
<body>
<script type = "text/javascript">
Var option = Confirm ("Choose the option?"); // True, FALSE
alert (option);
varping = Prompt ("Right, this?"); // null or Other
Alert (Popting);
</script>
</body>
</html>