JSFiddle - React, Tailwind, and code Playground

by Varun Krishna P

HTML

<form>
    <input type="text" class="input_date" />
</form>

<button onclick="createNewDatepickerInput();">Create new input</button>

JavaScript

$(function() {
    $('.input_date').datepicker();
});

function createNewDatepickerInput() {
    var $newInput = $('<input type="text" name="date123" class="input_date" />');
    $newInput.appendTo("form").datepicker();
}