title: ElementById finds element but won't add event listener (Chrome extension)
body: <p>I have a form in my extension's popup with the code:</p>
  
  <pre><code>&lt;button type="submit" id="update" class="btn btn-primary"&gt;Submit&lt;/button&gt;
  </code></pre>
  
  <p>And then in the attached script, the following code:</p>
  
  <pre><code>document.addEventListener("DOMContentLoaded", function(event){
    var button = document.getElementById("update");
    button.addEventListener("click", test);
    button.style.color="red";
  });
  
  
  
  function test(){
    console.log("test");
  }
  </code></pre>
  
  <p>The "button.style.color="red"" portion of the code works, so I know that the button was found successfully. However, I still receive this error upon load and when the button is clicked:</p>
  
  <pre><code>Uncaught TypeError: Cannot read property 'addEventListener' of null
  </code></pre>
  
  <p>How do I fix this :(</p>