Datepicker not working in div loaded by ajax
<p>I have a div which is populated by ajax. When done this way the datepicker is not called. I originally had the datepicker loaded in the header of the containing page but have tgried loading it within the script which calls the div content but again no luck. The Jquery library is called in the header of the main page. If I load the pages without ajax then there is no problem and the datepicker works fine.</p>

<pre><code>&lt;li&gt;&lt;a data-target="#halloffame" href="abscencerecords.php"&gt;Absence Records&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a data-target="#halloffame" href="abscencerequestform.php"&gt;Absence Request&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a data-target="#halloffame" href="personaldetails.php"&gt;Personal Details&lt;/a&gt;&lt;/li&gt;
        &lt;?php endif ?&gt;
        &lt;?php endif ?&gt;
        &lt;/ul&gt;&lt;/div&gt;
        &lt;div class="clear padding20"&gt;&lt;/div&gt;
&lt;div id="halloffame" class="bordered_box"&gt;&lt;/div&gt;
        &lt;script&gt;
  $('[data-target]').click( function (e) {
   $(document).ready(function() { $("#datepicker").datepicker({ dateFormat: 'dd/mm/yy' }); }); 
   $(document).ready(function() { $(".datepickermultiple").multiDatesPicker({ dateFormat: 'dd/mm/yy' }); });
    var target = $($(this).attr('data-target')); 
   target.load($(this).attr('href'));
    e.preventDefault(); // prevent anchor from changing window.location
  });
&lt;/script&gt;
</code></pre>