Open In App
Related Articles

HTML onpageshow Event Attribute

Improve Article
Save Article
Like Article

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 a single attribute script. The script is to be run on onpageshow event. This event is used within body tag.



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


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

  • Apple Safari 5
  • Google Chrome 3
  • Edge 12
  • Firefox 6
  • Opera 15
  • Internet Explorer 11
Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

Last Updated : 04 Aug, 2023
Like Article
Save Article
Similar Reads
Complete Tutorials