JSFiddle - React, Tailwind, and code Playground
by aztechy
HTML
Date: <input type="text" id="thedate"/>
<div id="checkDate">Check Date</div>
JavaScript
$('#thedate').datepicker();
$('#checkDate').bind('click', function() {
var selectedDate = $('#thedate').datepicker('getDate');
var today = new Date();
today.setHours(0);
today.setMinutes(0);
today.setSeconds(0);
if (Date.parse(today) == Date.parse(selectedDate)) {
alert('today!');
} else {
alert('not today');
}
});