<!DOCTYPE html>
<html>
 <head>
    <title>Web page events - Modern JS</title>
    </head>
<body onload="alert('Welcome to the page');">

  <img onmouseout="changeImgSrcSmall(this)" onmouseover="changeImgSrcLarge(this)" src="https://upload.wikimedia.org/wikipedia/commons/thumb/6/6a/JavaScript-logo.png/240px-JavaScript-logo.png" />

  <h1 onclick="this.innerHTML = 'Hi, this is a JS click event!'">Click on this text!</h1>

  <script>
    function changeImgSrcLarge(id) {
      id.src = "https://upload.wikimedia.org/wikipedia/commons/thumb/6/6a/JavaScript-logo.png/480px-JavaScript-logo.png";
    }
    function changeImgSrcSmall(id) {
      id.src = "https://upload.wikimedia.org/wikipedia/commons/thumb/6/6a/JavaScript-logo.png/240px-JavaScript-logo.png";
    }
  </script>
</body>

</html>