How can I check whether my radio button is checked within ONE div among many others?
<p>I have many div's called "each_item", one behind another.
I am trying to check whether a radio has been checked WITHIN this very div.</p>

<p>My problem is that with my jquery code (see below), all radio buttons of all "each_item" div's are tested. I probably need to use <code>$(this)</code>, but I don't know how to use it in the selector I used below ( that is <code>$('input:radio[name=gender]:checked')</code>)</p>

<pre><code>&lt;div class='each_item'&gt;
&lt;input type='radio' name='gender' value='m'&gt;
&lt;input type='radio' name='gender' value='f'&gt;

&lt;input type='button' id='btn'&gt;
&lt;/div&gt;
</code></pre>

<p>The jquery i tried is this:</p>

<pre><code>$('#btn').click(function(){

    if ($('input:radio[name=gender]:checked').length &lt; 1)
        alert('nothing was checked');
    });
</code></pre>

<p>Thanks a lot if you could help me out.</p>
