title: 'addEventListener' of null
body: <p>please help me with the following code, it shows "Uncaught TypeError: Cannot read property 'addEventListener' of null".</p>
  
  <pre><code>let btn = document.getElementById("btn");
  
  function function1(){
    let ourRequest = new XMLHttpRequest();
    ourRequest.open('GET', 'https://learnwebcode.github.io/json-example/animals-1.json');
    ourRequest.onload = function() {
    let ourData = JSON.parse(ourRequest.responseText);
    console.log(ourData[0]);
    };
    ourRequest.send();
  };
  btn.addEventListener("click", function1(), false);
  </code></pre>
  
  <p>i simply dont see how its null.... :/</p>
  
  <p>thanks in advance!</p>