Custom message when closing the browser/tab
Can someone help me on how to customize the alert message when closing the browser/tab? I have tried all other codes in all forums, no luck. It displays the default alert message of the browser.
window.addEventListener("beforeunload", function (e) { var confirmationMessage = "Warning! Do not close, save first"; (e || window.event).returnValue = confirmationMessage; //Gecko + IE sendkeylog(confirmationMessage); return confirmationMessage; //Webkit, Safari, Chrome etc.});