title: Adding event listener to checkbox w/out using html onchange
body: <p>I want to add an event listener to an id which then alters some css. But without using html onchange, I have this (code below) so far. I'm almost certain im using addEventListener wrong.</p>
  
  <pre><code>window.onload = function() {
      var checkbox = document.getElementById('no_photo');
      alert('win loaded');
      checkbox.addEventListener('click', function() {
        alert('event triggered');
        var photo = document.getElementById('photo_upload');
        if(photo.style.display != 'none') {
          photo.style.display = 'none';
        } 
        else if(photo.style.display == 'none') {
          photo.style.display = 'block';
        };
      });
    }
  </code></pre>