JSFiddle - React, Tailwind, and code Playground
by nickywaites
HTML
<input type="button" id="click" value="Trigger">
<input id="toast" type="text">
JavaScript
$(function() {
var datepicker = $('#toast').datepicker({
showOtherMonths: true,
selectOtherMonths: true,
dateFormat: "yy/mm/dd",
onSelect: function() {
console.log('onSelect');
}
});
$('#click').click(function(evt) {
evt.preventDefault();
datepicker.trigger('onSelect');
});
});