title: Check if all inputs with a certain class are empty using jQuery
body: <p>I'm trying to check if all input fields with a certain class are empty. 
  Right now I have the following code:</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;input type="text" class="required-entry"&gt;
  &lt;input type="text" class="required-entry"&gt;
  &lt;input type="text" class="required-entry"&gt;
  &lt;button class="check-fields"&gt;Check Fields&lt;/button&gt;
  </code></pre>
  
  <p><strong>jQuery</strong></p>
  
  <pre><code>$('.check-fields').on('click', function () {
  
    var value = $('.required-entry').filter(function () {
      return this.value != '';
    });
  
    if (value.length == 0) {
      alert('Please fill out all required fields.');
    } else if (value.length &gt; 0) {
      alert('Everything has a value.');
    }
  });
  </code></pre>
  
  <p>But this throws the message "Everything has a value." if ANY one of the inputs has a value. I'm trying to only throw that message when every input with this class has something in it.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$('.check-fields').on('click', function () {
  
      var value = $('.required-entry').filter(function () {
          return this.value != '';
      });
  
      if (value.length == 0) {
          console.log('Please fill out all required fields.');
      } else if (value.length &gt; 0) {
          console.log('Everything has a value.');
      }
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;input type="text" class="required-entry"&gt;
  &lt;input type="text" class="required-entry"&gt;
  &lt;input type="text" class="required-entry"&gt;
  &lt;button class="check-fields"&gt;Check Fields&lt;/button&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I also have this fiddle with slightly different code.. also throws the Everything has a value message when the first input is the only one filled.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$('.check-fields').on('click', function () {
      
      if($.trim($('.required-entry').val()) === '') {
          console.log('Please fill out all required fields.');
      } else {
          console.log('Everything has a value.');
      }
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;input type="text" class="required-entry"&gt;
  &lt;input type="text" class="required-entry"&gt;
  &lt;input type="text" class="required-entry"&gt;
  &lt;button class="check-fields"&gt;Check Fields&lt;/button&gt;</code></pre>
  </div>
  </div>
  </p>