Edit This Code:
See Result »
Close this window, press F5 or click on the link below to invoke the onbeforeunload event.
Click here to go to w3schools.com
Result: