How to make a confirmation box in JavaScript?
July 12, 08 by the programmerHave you ever wanted to make a confirmation box in JavasScript?
It’s very simple. For example if we want to add a confirmation box before deleting something this is how we can do it:
var yes_no = confirm(’Are you sure you want to delete this ….’);
if(yes_no){
if(yes_no){
//The user confirmed the deletion
//This is where the code for deleting will go
}else{
//The user declined the deletion
}
