title: JQuery datepicker not working after ajax call
body: <p>I have the following code</p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
         //included all jquery related stuff ..not shown here
      &lt;/head&gt;
      &lt;body&gt;
         &lt;button id = 'btn' /&gt;
         &lt;div id = 'ct'&gt;
               &lt;?php echo file_get_contents('my_ajax_stuff.php'); ?&gt;
         &lt;/div&gt;
      &lt;/body&gt;
      &lt;script&gt;
         $('.datepicker').datepicker({dateFormat: "dd-mm-yy"});
         $('#btn').click(function() {
             $.ajax({
              type: "GET",
              url: "my_ajax_stuff.php" ,
              success: function(response) {
                  $('#ct').html(response);
                  /*added following line to solve this issue ..but not worked*/
                  //$( ".datepicker" ).datepicker({dateFormat: "dd-mm-yy"});
  
              } ,
              error: function () {
                  $('#ct').html("Some problem fetching data.Please try again");
              }
          });
         });
      &lt;/script&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>The page </p>
  
  <blockquote>
    <p>my_ajax_stuff.php</p>
  </blockquote>
  
  <p>contains a jquery ui datepicker with class = 'datepicker'.On the first load the datepicker works.But when I click on the button to reload it again , the contents are replaced with new contents.But the datepicker is not working.I have tried initialising the datepicker inside the ajax success handler ,as you see.But it also failed.What is the issue.How can it be solved???</p>