title: Select the first radio button of multiple radio buttons groups with jQuery
body: <p>I would like to automatically select the first radio button of multiple radio buttons groups.</p>
  
  <pre><code>&lt;div class="element"&gt;
  &lt;input type="radio" name="group1" value="1"&gt;
  &lt;input type="radio" name="group1" value="2"&gt;
  &lt;input type="radio" name="group1" value="3"&gt;
  &lt;/div&gt;
  
  &lt;div class="element"&gt;
  &lt;input type="radio" name="group2" value="1"&gt;
  &lt;input type="radio" name="group2" value="2"&gt;
  &lt;input type="radio" name="group2" value="3"&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Here is the thing, while this works:</p>
  
  <pre><code>$('.element').each(function(){
      $(this).find('input[type=radio]:first').attr('checked', true);
  });
  </code></pre>
  
  <p>I can't figure out why I can't make it work using the :first selector using the each() method</p>
  
  <p>The code below doesn't work: it only selects the first radio button in the first div, can you tell me why?</p>
  
  <pre><code>$('.element input[type=radio]:first').each(function(){
      $(this).attr('checked', true);
  });
  </code></pre>
  
  <p>Thanks</p>