title: jQuery addClass to each element that has children with '.class'
body: <p>I'm trying to add a Class to each anchor inside <code>#somecontainer</code> whose children have <code>.someclass</code></p>
  
  <p>For example.</p>
  
  <pre><code>&lt;div id="container"&gt;
  &lt;a&gt;&lt;span class="someclass"&gt;&lt;/span&gt;&lt;/a&gt;
  &lt;a&gt;&lt;/a&gt;
  &lt;a&gt;&lt;span class="someclass"&gt;/span&gt;&lt;/a&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>In the above code i want the first and third anchors to have a class '.anotherclass'
  I tried this code but it doesn't seem to work</p>
  
  <pre><code>jQuery('#container a').each(function(){
  jQuery(this).has('.someclass').addClass('anotherclass');
  })
  </code></pre>
  
  <blockquote>
    <p><strong>Update</strong>: <code>.has()</code> returns a <code>boolean</code> and not jQuery object. That's why the
    code  didn't work</p>
  </blockquote>