title: javascript Hide/show div on checkbox: checked/unchecked
body: <p>I am trying to make a function in javascript, that will hide / show particular div in my registration form, depending on the state of my checkbox (checked or not). 
  Here is my function:</p>
  
  <pre><code> function doruc() {
      var elem = document.getElementById('powermail_fieldwrap_331');
          if (document.getElementById  ('powermail_field_doruovaciaadresa2_1').checked) {
          elem.display='block';
          } else {elem.display:none;}
  }
  </code></pre>
  
  <p>It isnt working. I am checking and unchecking my checkbox, but nothing happens. Oh and one more thing. I want that div to be initialized as hidden. Should I put in my css this? :</p>
  
  <pre><code> #powermail_fieldwrap_331{
   display:none;
   } 
  </code></pre>
  
  <p>I would highly appreciate any suggestions.</p>