alert(message);
<html> <head> <script type="text/javascript"> function show() { alert("It is an Alert dialog box"); } </script> </head> <body> <center> <h1>Hello World :) :)</h1> <h2>Welcome to lidihuo</h2> <p>Click the following button </p> <input type="button" value="Click Me" onclick="show();" /> </center> </body> </html>
confirm(message);
<html> <head> <script type="text/javascript"> function show() { var con = confirm ("It is a Confirm dialog box"); if(con == true) { document.write ("User Want to continue"); } else { document.write ("User does not want to continue"); } } </script> </head> <body> <center> <h1>Hello World :) :)</h1> <h2>Welcome to lidihuo</h2> <p>Click the following button </p> <input type="button" value="Click Me" onclick="show();" /> </center> </body> </html>
prompt(message, default_string);
<html> <head> <script type="text/javascript"> function show() { var value = prompt("Enter your Name : ", "Enter your name"); document.write("Your Name is : " + value); } </script> </head> <body> <center> <h1>Hello World :) :)</h1> <h2>Welcome to lidihuo</h2> <p>Click the following button </p> <input type="button" value="Click Me" onclick="show();" /> </center> </body> </html>