Estoy usando el selector de fechas de Tailwind y agrego nuevos elementos haciendo clic en un botón:
<html> <head> <!-- ... --> <script src="https://unpkg.com/flowbite@1.5.1/dist/datepicker.js"></script> </head> <body> <!-- ... --> <input datepicker type="text" placeholder="Select date"> <button>Add</button> <!-- ... --> <script> document.querySelector('button').addEventListener('click', function() { var input = document.createElement('input'); input.setAttribute('datepicker', ''); document.body.appendChild(input); document.querySelectorAll('[datepicker]').forEach(function(datepickerEl) { new Datepicker(datepickerEl, getDatepickerOptions(datepickerEl)); // ❌ Unhandled Promise Rejection: ReferenceError: Can't find variable: Datepicker }); }); </script> </body> </html>Una vez que se ha agregado un nuevo elemento, no tiene el selector de fecha. ¿Cómo puedo reiniciar el selector de fecha para todos los elementos nuevos?