title: Jquery Date Picker Event
body: <p>I've Javascript to create element input text box to store jQuery date picker, but it doesn't work:</p>
  <pre class="lang-js prettyprint-override"><code>jQuery(document).ready(function($) {
          $( &quot;#pohdddt&quot; ).datepicker({showOtherMonths: true,selectOtherMonths: true,dateFormat: 'dd.mm.yy',showOn: 'button',buttonImage: &quot;&lt;?php echo base_url()?&gt;icons/cal.gif&quot;, buttonImageOnly: true, showAnim: 'slideDown', duration: 'fast'});
  });
  
  
  var cell = document.createElement(&quot;td&quot;);
      var theInput = document.createElement('input');
      var img = document.createElement('img');
      img.setAttribute('alt', 'select date ');
              img.setAttribute('class', 'ui-datepicker-trigger');
              img.setAttribute('src',base_url_no_index+'icons/cal.gif');
              
              theInput.setAttribute('id', 'pohdddt'+i);
              theInput.setAttribute('name', 'pohdddt');
              theInput.setAttribute('value', '&lt;?php echo date('d.m.Y'); ?&gt;');
              theInput.setAttribute('size', '10');
              theInput.setAttribute('class','hasDatepicker');
  
              cell.appendChild(theInput);
              cell.appendChild(img);
              row.appendChild(cell);   
  </code></pre>
  <p>How to call jQuery event <code>Onclick</code> when this element is created?
  If so I'll create <code>var Ahref = document.createElement('a');</code>.</p>
  <p>Any suggestion ?</p>