title: Javascript - check if serialized form is empty
body: <p>I'm trying to check if the form inputs are all empty. It works fine when any input has value (returns true) but doesn't return false when input gets empty again.</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>var data;
  
  $('form :input').on('input', function() {
      data = $('form').serialize();
      console.log(data.indexOf('=&amp;') &gt; -1)
  })</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;form&gt;
    &lt;input type="text" name="in-1" /&gt;
    &lt;input type="text" name="in-2" /&gt;
    &lt;input type="text" name="in-3" /&gt;
    &lt;input type="text" name="in-4" /&gt;
    &lt;input type="text" name="in-5" /&gt;
    &lt;input type="text" name="in-6" /&gt;
    &lt;input type="text" name="in-7" /&gt;
    &lt;input type="text" name="in-8" /&gt;
  &lt;/form&gt;</code></pre>
  </div>
  </div>
  </p>