<body onpageshow="myFunction()"> - Javascript DOM Event

Javascript examples for DOM Event:onpageshow

Description

The onpageshow event occurs when a user navigates to a webpage.

Summary

Bubbles No
Cancelable No
Supported HTML tags: <body>

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body onpageshow="myFunction()">

<h1 id="demo"></h1>

<script>
function myFunction() {//from   w w w. j  ava 2s.c  om
    document.getElementById("demo").innerHTML = "Welcome To My Homepage!";
}
</script>

</body>
</html>

Related Tutorials