Sometimes in order to prevent the user from accidentally clicking refresh or closing the page, the edited content is not saved, and to give the user more choices, the following events can be added
onbeforeunload="window.event.returnValue" ='The content is not saved, dear'"
The display effect in IE is as follows:
The display effect in Chrome is as follows:
Window.event.returnValue=false; used to stop event processing.