javascript - i want to validate calender as departure and destination date and date should not be less than departure date? -


<html>   <body>    <input type="date" class="form-control" name="date" value="" id="departuredate"/>    <input type="date" class="form-control" name="date_arrival" id="arrivaldate" value="" />   </body> </html> 

this code giving date. want validate calender departure , destination date. destination date should not less departure date

include jquery before code , call below code on form submit:

<script>     var startdate = new date($('#departuredate').val());     var enddate = new date($('#arrivaldate').val());      if (startdate < enddate){     alert("date shoul geater");     }     </script> 

Comments