JavaScript alert () function detailed instructions

Source: Internet
Author: User
Keywords Web page production Ajax javascript
Tags ajax button dialog dialog box function javascript syntax use

Here is a brief introduction to the use of the JavaScript alert () function, the alert--pop-up message dialog box, and the Alert message dialog box is usually used for some informational messages to the user.

JavaScript alert () function

alert--Pop-up message dialog box (there is an OK button in the dialog box)

Alert, Chinese "reminder" means

Alert function syntax

alert (str);

alert function hint box diagram

Alert function argument

str--text to be displayed in the message dialog box

Alert function Description

The Alert message dialog box is typically used for some information about the user, such as when the wrong data is entered in 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, which means that no other action can be performed until the user clicks the button on the dialog box.

Tip: A message dialog box can often be used to debug a program.

Example

Alert ("hellodreamdu!");    Alert (' welcometo<br/>dreamdu! ');    Alert (' welcometondreamdu! '); Note that the second and third examples above, only a third example to implement line wrapping, reference to the ASCII table, using the BR tag in HTML can not wrap.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.