Javascript examples for DOM Event:addEventListener
The onunload event occurs once a page has unloaded (or the browser window has been closed).
Bubbles | No |
---|---|
Cancelable | No |
Supported HTML tags: | <body> |
<!DOCTYPE html> <html> <body> <h1>Welcome to my Home Page</h1> <script> document.getElementsByTagName("BODY")[0].addEventListener('unload', myFunction); function myFunction() {// ww w . java 2 s. c om console.log("here"); } </script> </body> </html>