Javascript examples for DOM Event:onpagehide
The onpagehide event occurs when the user is navigating away from a webpage.
Bubbles | No |
---|---|
Cancelable | No |
Event type: | PageTransitionEvent |
Supported HTML tags: | <body> |
<!DOCTYPE html> <html> <body onpagehide="myFunction()"> <h1 id="demo"></h1> <script> function myFunction() {//from w w w . j a va 2 s . c om document.getElementById("demo").innerHTML = "Welcome To My Homepage!"; } </script> </body> </html>