title: Last element in .each() set
body: <p>I have an issue, where by I am doing a simple form validation, that needs some custom stuff that the validation plugin could not do for me. Basically, I have a name, email and message field, all are required, but only email is really validated, the others just need to check if theyre not empty. Here is my current code: </p>
  
  <pre><code>$("#contactMe form").submit(function() {
      var email = $('.requiredEmail').val();
      if(email != 0)  {
          if(isValidEmailAddress(email))  {
              $('.requiredText').each(function() {
                  thisVal = $(this).val();
                  var $this = $(this);
                  if(thisVal != 0) {
                      console.log('Valid Field: '+thisVal);
                      if ($(this) == $(this).parent(':last')) {
                          console.log('Last field, submit form here');
                      }
                  }
              });
          } else {
              console.log('Email Not Valid');
          }
      } 
      return false;
  });
  </code></pre>
  
  <p>Just to explain, I am first checking the email address is valid via the isValidEmailAddress function, which is working. Then I am going through using each(), all the requiredText fields and checking if theyre not empty. When I get to the last  requiredText field, I want to submit the form using post or whatever. </p>
  
  <p><code>if ($(this) == $(this).parent(':last')) {</code> What I have there is obviously incorrect but I am not sure what can be used to check if it is the last in the each result set, and perform an action if true. </p>
  
  <p>Can anybody help me out here? </p>
  
  <p>Thanks in advance. </p>