Use if-else with confirm dialog : Dialog « Window Browser « JavaScript DHTML
- JavaScript DHTML
- Window Browser
- Dialog
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>
Related examples in the same category