1: Just reminders, can not make any changes to the script;
2: Generally used to confirm, return TRUE or false, so it can be easily used for if...else ... Judge
3: A dialog box with input, you can return the user filled in the string, common in some of the message or forum input where the insert UBB format picture
We'll show you the following separately:
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> <ptml xmlns=" http://www.w3.org/1999/xhtml "> <pead> <meta http-equiv=" Content-type "content=" text/html; charset=gb2312 "/> <title> three pop-up dialog box usages </title> <script language=" JavaScript "> Function Ale () {// This basically has nothing to say, is to pop up a reminder of the dialog box alert ("I'm sure you are now using demo one"); Function firm () {//The value returned by the dialog box (TRUE or FALSE) if (confirm) ("Are you sure you want to visit the cloud-dwelling community?") ) {//If true, turn the page to thcjp.cnblogs.com location.href= "http://www.jb51.net"; else {//otherwise stated, illustrious alert ("You have pressed the cancellation, that is to return false"); } function Prom () {var name=prompt ("Please enter your first name", "");//Assign the input to the variable name,//Note that the prompt has two parameters, preceded by a hint, followed by a dialog box after the dialog box with the default value if (name)//if returned with content {alert (welcome: + Name)}} </script> </pead> <body> <p> dialog box three ;/p> <p>1: Just a reminder that you can't make any changes to the script;</p> <p>2: Generally used to confirm, return TRUE or false, so it can be easily used for if else judgment </p> <p >3:A dialog box with input, you can return the user filled in the string, common in some message or forum input where the insert UBB format pictures </p> <p> below we demonstrate:</p> <p> demo one: Reminder dialog box </p> <p> <input type= "Submit" name= "Submit" value= "submitted" onclick= "ale ()"/> </p> <p> Demo II: Confirmation dialog box </p> <p> <input type= "Submit" Name= "Submit2" value= "Submit" onclick= "firm ()"/> </p> <p> Demo Three: Require user input, then give results </p> <p> <input type= "Submit" Name= "Submit3" value= "submit" onclick= "Prom ()"/> </p& Gt </body> </ptml>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]