Avoid execution goes on in a .each loop
<p>I've got a code like this one to see whether some radio buttons have been checked or not. I'm using .each function of jquery to show an alert when I find a group of radio buttons with the same name value and none of them have been checked. When I find one I want to fire an alert and return false, but after the alert is shown the execution of the .each stops but the lines after .each function are executed (I mean true value is executed).</p>

<pre><code>$(":radio").each(function(){
    var name = $(this).attr('name');
    var numAnswered = $(":radio").filter('[name='+name+']').filter(":checked").length;
    var notAnswered = numAnswered == 0;
    if(notAnswered){
        alert("Must answer all questions");
        return false;
    }
});
console.log('still goes here even when alert is fired');
return true;
</code></pre>

<p>How can I avoid this situation?</p>

<p>Thanks.</p>
