title: Days difference from html5 form date
body: <p>how can obtain de difference of two dates in days from an html5 form with date picker ?</p>
  
  <p>i have tried with something like this, that didn't work yet: it showed NaN (Not a Number)</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;body&gt;
          &lt;form oninput="c.value=b.value-a.value;"&gt;
              date a:&lt;input type="date" id="a" value=""&gt;
              date b:&lt;input type="date" id="b" value=""&gt;
              &lt;br&gt;
              c = b-a in days:&lt;output name="c" for="a b"&gt;&lt;/output&gt;&lt;br&gt;
          &lt;/form&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>