var startDate = new Date($('#startDate').val()); var endDate = new Date($('#endDate').val()); if (startDate < endDate){ // Do something }