title: jQuery - Remove href attribute when checkbox is NOT checked
body: <p>I have a form with a "click here to accept terms and conditions" checkbox at the end before the "continue to checkout" link.</p>
  
  <p>Using jQuery I want to remove the href attribute of the "continue shopping" link when the checkbox is NOT checked, and when a user selects the checkbox the href attribute is added back to the link.</p>
  
  <p>The code I am using is below, but this is not working for some reason:</p>
  
  <pre><code>jQuery(document).ready(function() {
  
  if ($('input#tandc').is(':checked')) {
      jQuery("#continue_shopping").attr("href");
  }
  else
      jQuery("#continue_shopping").removeAttr("href").css({"opacity" : "0.3", "cursor":"default"});
      });
  </code></pre>
  
  <p>my html markup is something like this:</p>
  
  <pre><code>&lt;input type="checkbox" name="tandc" value="tandc" id="tandc" required&gt;
      I accept the &lt;a href="/terms-and-conditions"&gt;Terms and Conditions&lt;/a&gt;
  &lt;/input&gt;
  &lt;a id="continue_shopping" href="/store/shopping-cart/shipping/"&gt;Continue Shopping&lt;/a&gt;
  </code></pre>