html tutorial - onpageshow Attribute in HTML - html5 - html code - html form

  • The onpageshow attribute occurs when a user redirect to a webpage.
  • The onpageshow attribute is related to the onload attribute.
  • The onload attribute happens when the page loads first.
  • The onpageshow attribute happens every time the page is loaded, whereas the onload event does not happens though the page is loaded from the cache.
  • The onpageshow attribute is the part of the Event Attributes.

Syntax for onpageshow attribute in HTML:

<body onpageshow="script">

Applies To:

Element Attribute
<body> onpageshow

Attribute Values:

Value Description
script The script can run on onpageshow

Sample Coding for onpageshow Attribute in HTML:

Tryit<!DOCTYPE html>
        <title>Wikitechy onpageshow attribute</title>
    <body onpageshow="onPageShow()">
    <h1>Wikitechy HTML onpageshow Attribute </h1>
     function onPageShow() 
        alert("Welcome To Wikitechy!");

Code Explanation for onpageshow Attribute in HTML:

onpageshow Attribute Code Explanation

  1. The onpageshow attribute calls the JavaScript Function onPageShow() and occurs when a user navigates the page every time.
  2. The JavaScript Function onPageShow() executes the alert dialogue box with the message ” Welcome to Wikitechy!”.

Output for onpageshow Attribute in HTML:

onpageshow Attribute Tag Output

  1. On webpage loading, the alert box will be displayed with the message ” Welcome to Wikitechy!”

Browser Support for onpageshow Attribute in HTML:

Yes 11.0 Yes 5.0 Yes

Related Searches to onpageshow attribute in html

Adblocker detected! Please consider reading this notice.

We've detected that you are using AdBlock Plus or some other adblocking software which is preventing the page from fully loading.

We don't have any banner, Flash, animation, obnoxious sound, or popup ad. We do not implement these annoying types of ads!

We need money to operate the site, and almost all of it comes from our online advertising.

Please add to your ad blocking whitelist or disable your adblocking software.