title: Uncaught TypeError: Cannot set property 'checked' of null
body: <p>I am using a Javascript at <a href="https://stackoverflow.com/questions/19734907/javascript-hide-show-div-on-checkbox-checked-unchecked/19734954#19734954">javascript Hide/show div on checkbox: checked/unchecked</a>.</p>
  
  <pre><code>var elem = document.getElementById('powermail_fieldwrap_331'),
      checkBox = document.getElementById('powermail_field_doruovaciaadresa2_1');
  checkBox.checked = false;
  checkBox.onchange = function doruc() {
      elem.style.display = this.checked ? 'block' : 'none';
  };
  checkBox.onchange();
  </code></pre>
  
  <p>I changed "checkBox.checked = false;" to "checkBox.checked = true;"
  It works anyway but produces an error:
  <strong>Uncaught TypeError: Cannot set property 'checked' of null</strong></p>
  
  <p><a href="http://jsfiddle.net/xSvLc/323/" rel="nofollow noreferrer">Demo</a></p>
  
  <p>In this case, how I fix this error?</p>
  
  <p>Thanks.</p>