Skip to content
Related Articles

Related Articles

HTML | onpageshow Event Attribute

View Discussion
Improve Article
Save Article
Like Article
  • Difficulty Level : Easy
  • Last Updated : 08 Aug, 2021

This event occurs when a user navigates to a website. This event is quite similar to onload event but it occurs after the onload event. It occurs every time when the page is loaded whereas the onload event does not occur when the page is loaded from cache.
Supported Tags: 

  • <body>


<element onpageshow = "script"> 

This event contains single attribute script. The script is to be run on onpageshow event. This event is used with in body tag.


<!DOCTYPE html>
        <title>onpageshow event</title>
    <body onpageshow="Geeks()">
        <h1 style="color:green;text-align:center;">GeeksForGeeks</h1>
            function Geeks() {
                alert("Welcome to GeeksForGeeks!");


Supported Browsers: The browser supported by onpageshow Event Attribute are listed below: 

  • Apple Safari 5.0 and above
  • Google Chrome
  • Firefox
  • Opera
  • Internet Explorer 11.0 and above


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!