title: Enable submit button when select checkbox
body: <p>I have try a few examples of enable the submit button when checkbox is selected but i'm getting nowhere. Below is one of my attempts, where the submit button is disabled until the checkbox is selected. Please let me know what am i missing.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function checked(sub1) {
    var myLayer = document.getElementById(sub1);
    var input = myLayer.childNodes[0];
    if (input.checked == true) {
      myLayer.disabled = "";
    } else {
      myLayer.disabled = "disabled";
    }
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;p style="color: #FF0000; font-weight: bold;"&gt;I have read and agree to the terms and conditions
    &lt;input type="checkbox" id="termsChkbx " onchange="checked('sub1')" /&gt;
  &lt;/p&gt;
  
  &lt;p&gt;
    &lt;input type="submit" name="submit" value="Order now!" id="sub1" disabled="disabled" /&gt;
  &lt;/p&gt;</code></pre>
  </div>
  </div>
  </p>