अवलोकन
onbeforeunload इवेंट दस्तावेज़ अनलोड होने से ठीक पहले ट्रिगर होता है, जिससे उपयोगकर्ता को पुष्टि संदेश दिखाया जा सकता है।
उदाहरण
<!DOCTYPE html> <html> <body onbeforeunload="return myFunction()"> <a href="https://www.qries.com">Click to open Qries</a> <script> function myFunction() { return "Working with onbeforeunload event"; } </script> </body> </html>