JS Popup Dialog Function alert (), confirm (), prompt ()

Source: Internet
Author: User

1, Warning message box alert ()

The alert method has a parameter, which is the text string that you want to display to the user. The string is not in HTML format. The message box provides a OK button to let the user close the message box, and the message box is a modal dialog box, which means that the user must close the message box before proceeding.

2, Confirm message box confirm ()

Use the confirmation message box to ask the user a yes-or-no question, and the user can choose to click the OK button or click the Cancel button. The return value of the Confirm method is true or false. The message box is also a modal dialog box: The user must close the dialog box (click a button) before the next action can be made.

3, Prompt message box prompt ()

The Hint message box provides a text field where the user can enter an answer in response to your prompt. The message box has a "OK" button and a "Cancel" button. If you provide a secondary string argument, the prompt message box displays the auxiliary string as the default response in the text field. Otherwise, the default text is "<undefined>". Similar to the alert () and Confirm () methods, the Prompt method also displays a modal message box. The user must close the message box before continuing.

4, example

  

JS Popup Dialog Function alert (), confirm (), prompt ()

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.