Try this one:
<!doctype html>
<html>
<head>
<title>JS Window onload event</title>
</head>
<body>
<h1>Welcome to Studytonight!</h1>
<p>We hope you are enjoying the course.</p>
<script>
function showAlert() {
alert("App loaded");
}
// write code here
window.onload=showAlert();
</script>
</body>
</html>