title: If checkbox is checked condition Javascript
body: <p>I have a simple <code>checkbox</code> and am trying to determine if it is checked or not in JS.</p>
  <pre><code>var checkbox = document.getElementById('checkbox').checked;
  console.log(checkbox);
  if(checkbox == 'true'){
      console.log('test');
  }
  </code></pre>
  <p>My first <code>console.log()</code> returns <code>true</code> or <code>false</code> as expected, however even if it never goes into the <code>if()</code> statement even when it is <code>true</code>.</p>
  <p>What am I missing?</p>