Warning boxes are often used to ensure that certain information is available to users.
When the warning box appears, the user needs to click the OK button to proceed.
The window.alert () method can directly use the alert () method without a window object.
A confirmation box is usually used to verify whether a user action is accepted.
When the confirmation card pops up, the user can click "Confirm" or "Cancel" to confirm the user operation.
When you click "OK", the confirmation box returns true. If you click "Cancel", the confirmation box returns false.
The window.confirm () method can directly use the confirm () method without a window object.
The prompt box is often used to prompt the user to enter a value before entering the page.
When the prompt box appears, the user needs to enter a value and then click the confirm or cancel button to continue the operation.
If the user clicks OK, the return value is the value entered. If the user clicks Cancel, the return value is null.
window.prompt () method can directly use the prompt () method without a window object.
The popup uses backslash + "n" (\ n) to set a newline.