JS pop-up box, dialog box, cue box, pop-up window summary __js

Source: Internet
Author: User
JS pop-up box, dialog box, cue box, pop-up window summary

One, JS three of the most common dialog box

[JavaScript]  View plain copy//====================== js Most popular three kinds of pop-up dialog boxes  ========================           //Pop-up dialog box and output a tip information        function ale ()  {            //Pop up a dialog box             alert ("hint information.") ");          }          //pop-up an inquiry box, Have OK and Cancel button        function firm ()  {            //the values returned by the dialog box   (true  or  false)             if  (confirm) ("Are you sure about submitting it?") )  {               alert ("click OK");            }            else {   &Nbsp;           alert ("click Cancel");            }          }          //pops up an input box and enters a text that can be submitted to        function prom ()  {            var name = prompt ("Please enter your name",  " ");  //the input to the variable  name ,               Note here that the prompt has two parameters, preceded by a hint, followed by the default value in the dialog box after the dialog box             if  (name)//if returned with content            {                alert ("Welcome:"  + name)            }          }  
Second, click the button when the commonly used in the 6 prompt box and operation

[HTML] view Plain Copy <!-----------button prompt box----------> <input type= "button" Name= "btn2" id= "btn2" value      = "Delete" onclick= "return confirm (' yes/no ');); <!-----------button Prompt box----------> <input type= "button" name= "btn2 id=" btn2 "value=" hint "onclick=" JavaScript: Alert (' Are you sure you want to delete it?      '); <!-----------submit button----------> <input type= "button"

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.