title: jQuery Datepicker does not work in dynamic element
body: <p>I have a problem. jQuery Datepicker does not work in a dynamic form, so you can't pick a date. Here is my demo link <a href="http://gestionale.odoyabooks.com/sum.php" rel="nofollow">http://gestionale.odoyabooks.com/sum.php</a>.</p>
  
  <p>JavaScript:</p>
  
  <pre><code>&lt;script&gt;
  $(document).ready(function() {
      $('.input_date').on('click', function() {
      $(this).datepicker('destroy').datepicker({showOn:'focus'}).focus();
          });
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>&lt;form action="" method="POST"&gt;
  
  &lt;div class="yes"&gt;
      &lt;div id="cost1" class="clonedCost" style="display: inline;"&gt;
          &lt;table  border="0"&gt;
            &lt;tr&gt;          
              &lt;td&gt;&lt;label class="date" for="date"&gt;Date&lt;/label&gt;&lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
              &lt;td&gt;&lt;input class="input_date" id="date" type="text" name="date[]" /&gt;&lt;/td&gt;
            &lt;/tr&gt;
          &lt;/table&gt;
      &lt;/div&gt;
      &lt;div id="addDelButtons_cost"&gt;&lt;input type="button" id="btnAdd" value=""&gt; &lt;input type="button" id="btnDel" value=""&gt;&lt;/div&gt;
  &lt;/div&gt;
  
  &lt;/form&gt;
  </code></pre>