This is my code
function confirm(){
okBtn.on('click', function(){
// return true from confirm function
});
cancelBtn.on('click', function(){
// return false from confirm function
});
}
if(confirm()){
// make something. I need to keep this code here, not in confirm function
}
I need to execute callback after okBtn or cancelBtn are clicked. I need to keep callback code not in function, coz I have a lot of cases that use this function.
"confirm("message")"which do the same."JavaScript confirm"