Mega Code Archive

 
Categories / JavaScript Tutorial / Statement
 

Use ifelse to check the returning value from a confirm dialog

< html> <head> <title>A Simple Page</title> <script language="JavaScript"> <!-- var response = confirm("Do you want to proceed with this book?  Click OK to proceed otherwise click Cancel."); if ( response == true ) {    alert("A fine choice!") }else{    alert("A not fine choice!") } //  --> </script> </head> <body> </body> </html>