title: Why won't .attr('checked','checked') set?
body: <p>I have the following snippet of code (I'm using jQuery 1.4.2):</p>
  
  <pre><code>$.post('/Ads/GetAdStatsRow/', { 'ad_id': id }, function(result) {
      $('#edit_ads_form tbody').prepend(result);
      $(result).find('td.select-ad input').attr('checked','checked').click();
  });
  </code></pre>
  
  <p>Assume that the post works correctly and returns a correct pre-built <code>&lt;tr&gt;</code> with some <code>&lt;td&gt;</code>s. Here's the weirdness: the <code>$(result).find()</code> line finds the correct input (which is a checkbox, as it's the only input in the cell) and runs the chained <code>click()</code> function correctly, but it REFUSES to set the box as checked, which I need to happen. </p>
  
  <p>Here's a crazy twist, too... when I get super specific and change the <code>$(result).find()</code> line to this (the id of the checkbox):</p>
  
  <pre><code>$('#ad_' + id).click();
  </code></pre>
  
  <p>It checks the box, but doesn't run the <code>click()</code> function! If I set it to</p>
  
  <pre><code>$('#ad_' + id).attr('checked','checked').click();
  </code></pre>
  
  <p>it runs the click function as though the box were checked, but the box remains unchecked, and if I do</p>
  
  <pre><code>$('#ad_' + id).click().attr('checked','checked');
  </code></pre>
  
  <p>it does nothing at all.</p>
  
  <p>What in the world could be the matter with this? I'm running out of hair....</p>
  
  <p>Thanks!</p>
  
  <h2>EDIT</h2>
  
  <p>Here's how I set my click event in the <code>$(function())</code> call:</p>
  
  <pre><code>$('td.select-ad input').live('click',AdPreview.selectAd);
  </code></pre>
  
  <p>It works as is for all the other checkboxes, and the newly-added checkbox does indeed work if clicked by hand.</p>
  
  <h2>EDIT 2</h2>
  
  <p>After some digging I discovered that this: </p>
  
  <pre><code>$('#ad_' + id).click();
  </code></pre>
  
  <p>actually <em>does</em> call my click function in addition to checking the box. However, when the click function is called (I've already checked to make sure that <code>input</code> is the correct checkbox and it is), </p>
  
  <pre><code>var input = $(this);
  console.log(input.is(':checked'));
  </code></pre>
  
  <p>the log returns false, even though the box is actually checked! GAH WTF</p>