JSFiddle - React, Tailwind, and code Playground
by vinishanto
JavaScript
window.onbeforeunload = function (e) {
var e = e || window.event;
//IE & Firefox
if (e) {
e.returnValue = 'Your information has not been saved yet. If you leave now, the information might be lost.';
}
// For Safari
return 'Your information has not been saved yet. If you leave now, the information might be lost.';
};