JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<input type="text" class="cal" />
<a href="#" id="datepicker">Show </a>
<div id="newdp"></div>
JavaScript
var datePickerOptions = {
dateFormat: 'yy-mm-dd',
firstDay: 1,
changeMonth: true,
changeYear: true,
}
$(document).ready(function () {
$(".cal").datepicker(datePickerOptions);
});
$('#datepicker').click(function(){
var html = '';
html += '<input type="text" class="cal" />';
$('#newdp').html(html);
});