JSFiddle - React, Tailwind, and code Playground

by Suganya Rajasekar

HTML

<link rel="stylesheet" href="http://code.jquery.com/ui/1.8.21/themes/base/jquery-ui.css">
<div id="focusin"></div>
<button id='test'>
test
</button>

JavaScript

$(function() {
  $(document).on("focusin", ".datePick", function() {

    $(this).datepicker({
      dateFormat: "dd/mm/yy",
      changeMonth: true,
      changeYear: true,
      onClose: function() {
        $(this).valid();
      }
    });
  });
});

$(document).on("click", "#test", function() {
  $('#focusin').append('<input class="datePick" name="datepicker" />');
});