Create a Confirmation box with Yes and No Options
confirm() and prompt method.
Yes Or No option Using ConfirmBox
A dialogue box with a personalized message that you can define as its argument will be displayed by the
let isExecuted = confirm("Are you sure to leave this pagde?"); console.log(isExecuted);
confirm() returns true if the user clicked the OK button. When the Cancel button is pressed, the method returns false.
Originally published at https://www.js-tutorials.com on December 16, 2022.