title: how to exit outside the jQuery .each loop
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1799284/how-to-break-exit-from-a-each-function-in-jquery">How to break/exit from a each() function in JQuery?</a>  </p>
  </blockquote>
  
  
  
  <p>I want to exit the jQuery <code>.each</code> loop on some condition, How can I do it. Will <code>exit;</code> code work?</p>
  
  <pre><code>var r = true; 
  $('.hour').each(function() {
     var $hours =  $(this).val();
     if ($hours == "") {
       alert(" Active Time is required"); 
       r = false; 
       //exit;         
     }    
  }); 
  return r; 
  </code></pre>