Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<h1>The Window Object</h1>
<h2>The addEventListener() Method</h2>
<p>This example adds two click events to the window.</p>
<p>Click anywhere in the document.</p>
<p id="demo"></p>
<script>
window.addEventListener("click", myFunction1);
window.addEventListener("click", myFunction2);
function myFunction1() {
  document.getElementById("demo").innerHTML += "First function was executed! "
}
function myFunction2() {
  document.getElementById("demo").innerHTML += "Second function was executed! "
}
</script>
</body>
</html>