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