Edit This Code:
<!DOCTYPE html>
<html>
<body onpageshow="myFunction()">

<p>This example demonstrates how 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>
function myFunction() {
    document.getElementById("demo").innerHTML = "Welcome To My Homepage!";
}
</script>

</body>
</html>


Result:
Try it Yourself - © w3schools.com
Privacy Policy