Avascript alert () function
alert--Popup message dialog box (there is an OK button in the dialog box)
Alert, meaning of "reminder" in Chinese
Alert function syntax
alert (str);
alert function Hint Box illustration
Alert function parameters
str--the text to display in the message dialog box
Alert function Description
The Alert message dialog box is typically used for some prompt information about a user, such as when incorrect data is entered in a form.
Tip: The message dialog box is provided by the system, so style fonts may be different in different browsers.
Tip: The message dialog box is exclusive, which means that no other action can be performed until the user taps the button on the dialog box.
Tip: A message dialog box is usually available for debugging programs.
Example
- Alert ("hellodreamdu!");
- Alert (' welcometo<br/>dreamdu! ');
- Alert (' welcometo\ndreamdu! ');
Note the second and third example above, only the third example can be used for line breaks, refer to the ASCII Code table, and use the BR tag in HTML to not wrap.
JavaScript alert () function