JSFiddle - React, Tailwind, and code Playground
HTML
<form>
<input type="text" class="input_date" />
</form>
<button onclick="createNewDatepickerInput();">Create new input</button>
CSS
input {
display: block;
margin-bottom: 10px;
font-size :16px;
}
JavaScript
$(function() {
$('body').on('click','.input_date', function() {
$(this).datepicker('destroy').datepicker({showOn:'focus'}).focus();
});
});
function createNewDatepickerInput() {
var $newInput = $('<input type="text" name="date123" class="input_date" />');
$newInput.appendTo("form");
}