Example:
HTML
<!DOCTYPE html>
<html>
<body onpageshow="myFunction()">
<h1>Hello World!</h1>
<script>
function myFunction() {
alert("Welcome!");
}
</script>
</body>
</html>
How to Execute a JavaScript when a user navigates to a webpage - HTML onpageshow Attribute | HTML Attribute |
Type: | Html |
Category: | Web Tutorial |
Sub Category: | HTML Attribute |
Uploaded by: | Admin |