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"