// JavaScript event for when the user closes the window. window.onbeforeunload = () => { return "Do you really want to close?"; };