I'm using this code to initialize a datepicker plugin on my input
$('.datepicker input').datepicker({
... (options)
});
This works fine if the input is already present on page load, but for dynamically added inputs this does not work.
I tried doing it this way instead which doesnt not work either.
$('body').datepicker({
selector: '.datepicker input',
... (options)
});
Is there a way to accomplish this?