<html>
<body>
<p>This example uses the HTML DOM to assign an "onpageshow" event to a body element.</p>
<p><strong>Note:</strong> The onpageshow event is not supported in Internet Explorer 10 and earlier versions.</p>
<h1 id="demo"></h1>
<script>
document.getElementsByTagName("BODY")[0].onpageshow = function() {myFunction()};
function myFunction() {
document.getElementById("demo").innerHTML = "Welcome To My Homepage!";
};
/* This is equivalent to assigning the event to the window object:
window.onpageshow = function() {
document.getElementById("demo").innerHTML = "Welcome To My Homepage!";
};
*/
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onpageshow_dom by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 03:02:57 GMT -->
</html>