title: Getting date difference in javascript
body: <p>I know this is easy, but I cannot seem to figure this out.</p>
  
  <p>I am looking for the difference in date between two dates in javascript.  </p>
  
  <pre><code>var date1 = new Date(document.getElementById("FromDate").value);  
  var date2 = new Date(document.getElementById("ToDate").value);  
  
  var date_diff = Math.abs(date2.getTime() - date1.getTime()/86400000);
          if (date_diff &gt; 90){
                alert('Selection criteria can not exceed 90 days.');
          }
  </code></pre>
  
  <p>My date_diff value is something unrealistic.<br>
  What is wrong with my code above?</p>