- The onpagehide attribute occurs when the user is redirecting away from a webpage.
- The onpagehide event is frequently used instead of the onunload event, as the onunload event causes the page is not being cached.
Syntax for onpagehide attribute in HTML:
Applies to:
Elements |
Attribute |
<body> |
onpagehide |
Attributes Values of onpagehide attribute in HTML:
Value |
Description |
Script |
The script can run on onpagehide |
Sample coding for onpagehide attribute in HTML:
Code Explanation for onpagehide attribute in HTML:
- The onpagehide attribute calls the JavaScript Function onPageHide() and occurs when a user navigates away from the page.
- The JavaScript Function onPageHide() display an alert box with the message ”Thank you, Please Visit again.”.
Browser Support for onpagehide attribute in HTML:
Related Searches to onpagehide attribute in html
pagehide event example
pagehide vs unload
window events javascript
html events
jquery pageshow
javascript events
jquery events
onload event belongs to which object
html tutorialshtml editor html code html form html tutorial html color html color codes html table html img html5 html code for website html and css html programs html website free html editor html5 tutorial wysiwyg html editor html tutorial pdf html converter php tutorial html example html tutorial css tutorial html css html tags html basics code html html online html mailto html lang html tags list