Javascript confirm message box

JavaScript confirm()

Use the confirm command in JavaScript to create a message confirmation box:

if (confirm ("Are you sure you want to delete the information?")) {
   alert ("You have chosen to delete!");
} else {
   alert ("You chose not to delete");

Different with alert box is confirm box have the "OK" and "Cancel" button. When the OK button is clicked, confirm() returns true, and when the Cancel button is clicked, false is returned.

Copyright 2014-2017 by All Rights Reserved.