title: HTML Checkboxes with Javascript Functions
body: <p>I'm just trying to get this checkbox to alert a message after it is checked and after it is unchecked by running a function in Javascript.  I can get it to display the "checked" message but can't get the "unchecked" alert to come up.</p>
  
  <pre><code>&lt;input type="checkbox" id="chbx" onchange="foo()"&gt;
  &lt;script type="text/javascript"&gt;
  var checkbox = document.getElementById("chbx");
  
   function foo(){
     if(checkbox.checked=true){
         alert("Checked!");
           }
     else {
          alert("UnChecked!");
           }
      };
  &lt;/script&gt;
  </code></pre>