Confirmation Dialog Box Using Javascript

Here I will show how to show Confirmation Dialog Box Using Javascript?

  1. <script type="text/javascript">  
  2.    function ConfirmationBox() {  
  3.       var Yesconfirm("User want's to continue..?");  
  4.       var check = new Boolean(Yes);  
  5.       if (check == true) {  
  6.          alert('want to continue Yes');  
  7.          return true;  
  8.       }  
  9.       else {  
  10.          alert('user dont continue');  
  11.          return false;  
  12.       }  
  13.    }  
  14. </script>  
  15. <div>  
  16.    <input type="button" value="Click Me" onclick="ConfirmationBox();" />  
  17. </div>   
Here I Have create javascript function such as ConfirmationBox() and that function call On button Click as onclick event then

Click on Click Me Button show as



And after ok Click then

Or cancel button click on

Next Recommended Reading JavaScript Message Box