Mega Code Archive

 
Categories / JavaScript DHTML / Window Browser
 

Use if-else with confirm dialog

<html> <head> <title>A Simple Page</title> <script language="JavaScript"> var response = confirm("OK or Cancel."); if ( response == true ){     alert("A fine choice!"); }else{     alert("Are you sure?  JavaScript is fun!"); } </script> </head> <body> </body> </html>