title: jquery if else, why does not work?
body: <p>In  the following function it goes through the if and the else, why is that?</p>
  
  <pre><code>function test(){
          $(".notEmpty").each(function() {
           if($(this).val() === ""){
              alert("Empty Fields!!");
              return;
             }
           else{
                  AddRow_OnButtonClick('tblMedicationDetail',6);
                }
       });
  
  }
  </code></pre>
  
  <p>Is there any if and else statement on jquery that I am not aware of?</p>
  
  <p>AddRow_OnButtonClick is a function to add a new row with 6 textboxes which I am attaching a className 'notEmpty' if any of the text boxes are empty the function AddRow_OnButtonClick should not be called and an alert should pop up.</p>
  
  <p>I dont know what am I doing wrong.</p>
  
  <p>Thanks</p>