title: Focus on the first empty input
body: <p>I am trying to focus the first empty input element on first submit but when the email and password inputs are empty, it always focuses on the password (latter) input first.</p>
  
  <p>How can I focus on the first empty input in a way that works across all browsers?</p>
  
  <pre><code> $('input').each(function() {
        if ($(this).val() == '') {
            this.focus();
        }
   });
  </code></pre>