title: checkbox oncheck javascript
body: <p>I have a checkbox That I need to show a div when it is clicked.  I have 3 different javascripts that i have attempted to get this to work with.</p>
  
  <pre><code>//function showhide() {
  //    var checkbox = document.getElementById("assist");
  //    var expanded1 = document.getElementById("expanded");
  //    var expanded2 = document.getElementById("expanded2");
  
  //    expanded1.style.visibility = (expanded1.style.visibility == 'false') ? "true" : "false";
  //    alert('test');
  //}
  function(){
  var checkbox = document.getElementById("assist");
  var expanded1 = document.getElementById("expanded");
  var expanded2 = document.getElementById("expanded2");
  checkbox.onchange = function () {
      expanded1.style.visibility = this.checked ? 'true' : 'false';
      alert('test');
  
  }
  //function check() {
  //    $('chk').click(function () {
  //        if (this.checked) {
  //            $("#expanded").show();
  //            $("#expanded2").show();
  //        }
  //        else {
  //            $("#expanded").hide();
  //            $("#expanded2").hide();
  //        }
  //    });
  //}
  </code></pre>
  
  <p>This is the checkbox below.</p>
  
  <pre><code>&lt;input type="checkbox" runat="server" id="assist"  onclick="showhide();" /&gt;&lt;/div&gt;
  </code></pre>
  
  <p>The divs that need to be shown/hidden are expanded and expanded2.</p>
  
  <p>I cannot get the javascript functions to be hit from the checkbox could someone tell me what is wrong.</p>