title: Add calendar datepicker with Jquery on dynamic table
body: <p>I am trying to add a Jquery calendar picker to a text box at the time of creation, but I cant find how.</p>
  
  <p>When I press a button, it will create a table, the element I want to attach the Jquery calendar picker is:</p>
  
  <pre><code>var txtDate = createTextInput(i, "txtDate", 8, 10);
  txtDate.className  = "datepicker";
  this.newcells[i].appendChild(txtDate);
  </code></pre>
  
  <p>I tried adding at the end :</p>
  
  <pre><code>txtDate.datepicker();
  </code></pre>
  
  <p>But does not work. Can anybody help?</p>
  
  <p>Thanks.</p>
  
  <p>Note: CreateTextInput is: </p>
  
  <pre><code>function createTextInput(i, strName, size, maxLength) {
      var input = document.createElement('&lt;input&gt;');
      input.type = "text";
      input.name = strName;
      input.id = strName + i;
      input.size = size;
      input.maxLength = maxLength;
  
      return input;
  }
  </code></pre>