Here is a brief introduction to the use of the JavaScript alert() function. alert-pops up a message dialog box, and the alert message dialog box is usually used to provide some prompt information to the user.
JavaScript alert() function
alert--pop-up message dialog box (there is an OK button in the dialog box)
alert, the meaning of "reminder" in Chinese
alert function syntax
alert(str);
alert Illustration of function prompt box
alert function parameters
str--the text to be displayed in the message dialog box
When incorrect data is entered into the form.
Tip: The message dialog box is provided by the system, so the style font may be different in different browsers.
Tip: The message dialog box is exclusive, that is, no other operations can be performed before the user clicks the button in the dialog box.
Tips: Message dialog boxes can often be used to debug programs.
Example
alert("Hellodreamdu!"); alert('Welcometo
dreamdu!'); alert('Welcometondreamdu!');
Pay attention to the second and third above Example, only the third example can achieve line wrapping. Refer to the ASCII code table. Line wrapping cannot be achieved using the br tag in HTML.
For more detailed instructions for using the JavaScript alert() function, please pay attention to the PHP Chinese website!