jQuery Plugin not working for elements added dynamically

jQuery Plugin not working for elements added dynamically

How do I get a jQuery Plugin working for elements added dynamically? I'm trying to add few date pickers to the DIV  datesList  each time you cick the Add button. The plugin doesnt work for the textboxes that are added dynamically. Can some one please advice?

Thank You

HTML

  
  1. <div class="datesList">
  2. <div class="date">
  3. <input type="text" class="date-picker"/>
  4. </div>
  5. </div>

  6. <div class="addDate">
  7. Add Date
  8. </div>

JS

  
  1. $(".date-picker").datepicker();

  2. $(".addDate").click(function(){
  3. var dList = $(".datesList");
  4. dList.find(".date").first().clone(false).appendTo(dList);
  5. });