How to use Confirm box in JavaScript

Confirm box in Javascript

Confirmation javascript used to confirm an important actions that are taking place on a website. For example, they may be used to confirm an order submission or logout from the website, change the login password we confirm that action before they done..

confirm box pops up, the user will have two option  OK or Cancel.

If clicks “OK”, means true. If clicks “Cancel”, means false
<script type=”text/javascript”>
function show()

var  mm=confirm(“Click Button!”);
if (mm==true)
{            alert(“OK!”);

<input type=”button” onclick=”show()” value=”show alert box” />

* Below Screen showing coding of JavaScript Confirm Box.

* Below screen Display the Confirm box
* Confirm box have two options OK OR Cancel.

I hope this confirm Javascript will  help you……

Leave a Reply

Your email address will not be published. Required fields are marked *