Horje

How to add a JavaScript immediately after a page has been loaded

See the code.
index.html
Example: HTML
<!DOCTYPE html>
<html>
<head>
<script>
function myFunction() {
  alert("Page is loaded");
}
</script>
</head>

<body onload="myFunction()">
<h1>Hello World!</h1>
</body>

</html>

Output should be:

How to add a JavaScript immediately after a page has been loaded




Type:
html
Category:
Web Tutorial
Sub Category:
HTML Window Event Attributes
Uploaded by:
Admin