I created datepicker using jquery on document ready method my code as below
$(document).ready(function(){
$("#setdate").html('<input type="text" class="datepicker">');
});
So my text box created at run time and I was added class name as datepicker when I click on that text box it not shows datepicker dialog because of it creates on page load times so I was added following code
$(this).on("click", ".datepicker", function(){
$(".datepicker").datepicker({
changeMonth: true,
changeYear: true
});
});
When I clicked on datepicker textbox at first time it shows nothing but next click it opens datepicker dialog can any one knows why this happens, I want open datepicker on first click how it possible?