title: Calculate number of days between two input type = "date" in html
body: <p>i have this piece of html code where i have two date pickers (input type="date") and a textfield with id="numdays". I want to calculate the number of days between the two selected dates and display the number in my textfield. I also want to restrict selection of a date earlier than today. i think this can be done throught javascript or jquery. Your help would be much appreciated. Thanks.</p>
  
  <pre><code>&lt;div id="reserve_form"&gt;
  
  &lt;div id="pickup_date"&gt;&lt;p&gt;&lt;label class="form"&gt;Pickup Date:&lt;/label&gt;&lt;input type="date" class="textbox" id="pick_date" name="pickup_date" &lt;/p&gt;&lt;/div&gt;
  
  &lt;div id="dropoff_date"&gt;&lt;p&gt;&lt;label class="form"&gt;Dropoff Date:&lt;/label&gt;&lt;input type="date" class="textbox" id="drop_date" name="dropoff_date"/&gt;&lt;/p&gt;&lt;/div&gt;
  
  &lt;div id="numdays"&gt;&lt;label class="form"&gt;Number of days:&lt;/label&gt;&lt;input type="text" class="textbox" id="numdays" name="numdays"/&gt;&lt;/div&gt;
  
  &lt;/div&gt;
  </code></pre>