title: Disable submit button if checkbox is not checked in jquery
body: <p>I have looked on here and tried every answer available, but it is still not working for me. I am trying to disable the submit button if checkbox is not checked. Here is my jquery:</p>
  
  <pre><code>var userTerms = $('input#agree');
       if(userTerms.is(':checked')) {
          $("#aggtxt").addClass("err");
          $("#aggtxt").removeClass("error");
          $("#aggtxt").text(" Agreed");
          $("#bookit").attr('disabled', false);
          }else{
          $("#aggtxt").removeClass("err");
          $("#aggtxt").addClass("error");
          $("#aggtxt").text(" Please check terms and conditions box");
          $("#bookit").attr('disabled', true);
          }
  
           if ($('#bookit').is(':disabled') == true) { 
              $("#booktxt").removeClass("err");
              $("#booktxt").addClass("error");
              $("#booktxt").text(" Before you can submit this form please check the errors in form marked in red.");
              }else{
                  $("#booktxt").addClass("err");
                  $("#booktxt").removeClass("error");
                  $("#booktxt").text(" Your information looks good, continue to booking...");
                  }   
  });
  </code></pre>
  
  <p>and part of my HTML form:</p>
  
  <pre><code>&lt;p&gt;&lt;span id="aggtxt"&gt;&lt;/span&gt;&lt;br /&gt;&lt;input type="checkbox" name="agree" id="agree" /&gt;  I agree to &lt;a href="http://travel.ian.com/index.jsp?pageName=userAgreement&amp;locale=en_US&amp;cid=379849" target="_blank"&gt;Terms and Conditions&lt;/a&gt; and understand Cancellation Policy.&lt;p&gt;
  &lt;span id="booktxt"&gt;&lt;/span&gt;
  &lt;input type="submit" name="bookit" value="" class="bookit" id="bookit" /&gt;
  </code></pre>