I need to alert users about unsaved changes before they leave a page.But i dont want to use the default alert box for that . Suppose consider calling showalertPopup()
Function displays the my designed alert box . How to replace it with the default alert box
window.onbeforeunload = function() {
$alertMsg = "Are you sure wanna leave this Page ?"
return $alertMsg;
};