I have a date picker and when I add the datepicker using innerHTML, it doesn't work.
while (currentMovedAmount < movedAmount)
{
currentMovedAmount++;
movedInContainer.innerHTML += extraAddresses.innerHTML;
movedInContainer.innerHTML += '<hr>';
$(".datepicker").datepicker();
}
This is the html that is being added. i have read in places just to re-assign the datepicker but still no luck, i tried to add an event on focus as well but still doesn't work.
<p>Postcode: <INPUT name="postCode" id="postCode" type="text" placeholder="Enter Postcode"></p>
<p>Date Moved In <INPUT name="dateMovedIn" id="dateMovedIn1" type="text" class="datepicker"></p>
Update Mistake on spelling datepicker i can get it working if i assign the to the id, however if the ids are the same will this stop the datepicker working from class?
Soultion Don't use the class ".datepicker"