JQuery .length of element(s) inside each() function
<p>Assuming I have the following HTML</p>

<pre><code>&lt;div class="news_item"&gt;
    &lt;div class="news_content"&gt;Some Content Here...&lt;/div&gt;
    &lt;img src="something.jpg" /&gt;
&lt;/div&gt;
</code></pre>

<p>I have the following JQuery code; which is suppose to count how many IMG elements there are within the particular DIV and change the CSS of DIV.news_content if there are <em>no</em> IMG elements.</p>

<pre><code>$('div.news_item').each(function() {
        if ($('img', this).length == 0) {
        $('div.news_content', this).css('background-color', '#cccccc');
    }
});
</code></pre>

<p>However $('img', this).length does not seem to work inside the each function.</p>
