This example demonstrates how to assign an "onbeforeunload" event to a body element.
Close this window, press F5 or click on the link below to invoke the onbeforeunload event.