title: Using jquery to preset html tickbox
body: <p>This code,</p>
  
  <pre><code>$("#x").removeAttr("checked").removeAttr("unchecked").attr("foo","bar");
  </code></pre>
  
  <p>Results in this html input:</p>
  
  <pre><code>&lt;input type="checkbox" id="x" foo="bar"&gt;
  </code></pre>
  
  <p>And yet this:</p>
  
  <pre><code>$("#x").removeAttr("checked").removeAttr("unchecked").attr("checked","true");
  </code></pre>
  
  <p>Results in this:</p>
  
  <pre><code>&lt;input type="checkbox" id="x" checked="checked"&gt;
  </code></pre>
  
  <p>What is going on? Despite this checked="checked" attribute, the checkbox still remains stubbornly unchecked.</p>
  
  <p>What is the best way to toggle the checked attribute of an HTML input?</p>