title: building jquery checkbox - can't set checked value
body: <p>this seems straightforward enough, I don't know if it's a bug, or just something I'm doing wrong.</p>
  
  <p>What I want to do is build a checkbox input in jquery, then return the string of the input. I have this code:</p>
  
  <pre><code>var obj = $('&lt;input&gt;');
  obj.attr('disabled', 'disabled');
  obj.attr('type', 'checkbox');
  obj.attr('checked', 'checked'); // this does not work!
  </code></pre>
  
  <p><strong>no matter how i try to render this obj, the 'checked' attribute never gets outputted.</strong></p>
  
  <p>So I have tried:</p>
  
  <pre><code>$('&lt;div&gt;').append(obj).remove().html();
  </code></pre>
  
  <p>and it returns:</p>
  
  <pre><code>&lt;input type="checkbox" disabled="disabled" /&gt;
  </code></pre>
  
  <p>I have tried setting an id attribute, it makes no difference. I have also tried this but it doesn't work:</p>
  
  <pre><code>obj.attr('checked', true);
  </code></pre>
  
  <p>Any suggestions on how to get the input tag rendered with the checked attribute set to 'checked' (via jquery)?</p>
  
  <p>I realise I can just do this with string concatenation, but now I really want to know why it's not working the way it should.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>You can try this for yourself in firebug.  Create the obj either my way or <strong>cletus</strong>' way, then try to render it to a string. You'll find that the 'checked' attribute never gets rendered.</p>