Three methods of the JavaScript pop-up dialog box _ javascript skills

Source: Internet
Author: User
This article mainly introduces three pop-up dialog boxes in javascript, namely the alert () method, confirm () method, prompt () method, if you are interested in the relevant knowledge of the javascript pop-up dialog box, you can learn about javascript and find that we have used the alert () method, prompt () method, prompt () method, and prompt () in some examples () they all bring up a dialog box on the screen and display the content in the brackets on it. Using this method makes the page more interactive, in fact, we often use this type of dialog box when Browsing Web pages. When users communicate with applications in two ways, they often need to use the dialog box.

The three javascript dialogs are obtained by calling the three methods alert (), confirm (), and prompt () of the window object.You can use these dialogs to complete js input and output, and implement JavaScript code that can interact with users.

Today, I will briefly introduce the three pop-up dialog boxes in Javascript. I will explain these methods in detail and then compare them, start our js journey '(* pipeline _ Pipeline *)′......

First: alert () method

The alert () method is the easiest way to use in these three dialogs. It can be used to display the text information in the alert () brackets in the dialog box in a simple and clear way, we call it an alert dialog box. The information to be displayed is placed in brackets. The dialog box contains a "OK" button. After you read the displayed information, you can click this button to close the dialog box. The following is an example of using the alert () method. The Code is as follows:

Compile an html page

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.