title: Uncaught ReferenceError: parentsCheck is not defined
body: <p>I am very new to JS, but am trying to create a checkbox that when checked will reveal a div with an id of "second_row", and when unchecked will hide it (unchecked by default). Am I missing some code? Is my syntax incorrect? I could really use some help. Thanks for givin a newbie a hand!</p>
  
  <p>Html:</p>
  
  <pre><code>&lt;input type="checkbox" name="under_18" id="under_18" class="check" value="under_18" form="contest_form" onclick="parentsCheck()" /&gt;
  </code></pre>
  
  <p>JavaScript:</p>
  
  <pre><code>&lt;script&gt;
  
  function parentsCheck()
  {
    var check1 = document.getElementById('under_18'),
  
      if (check1.checked === true) { 
        document.getElementById('second_row').style.display = 'block';
      }
      else if (check1.checked === false) { 
        document.getElementById('second_row').style.display = 'none';
      }
  }
  
  &lt;/script&gt;
  </code></pre>
  
  <p>P.S. Dont know if it matters, but the checkbox is in a table cell.</p>