Here I will show how to show Confirmation Dialog Box Using Javascript?
- <script type="text/javascript">
- function ConfirmationBox() {
- var Yes= confirm("User want's to continue..?");
- var check = new Boolean(Yes);
- if (check == true) {
- alert('want to continue Yes');
- return true;
- }
- else {
- alert('user dont continue');
- return false;
- }
- }
- </script>
- <div>
- <input type="button" value="Click Me" onclick="ConfirmationBox();" />
- </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
Or cancel button click on