Datepicker and dynamic html - not finding id

Datepicker and dynamic html - not finding id

Hi,
 
I am creating a table dynamically, and the table cell in question creates a text box as follows:
 
  1.  var cell1 = row.insertCell(0);
  2.  var el1 = document.createElement('input');
  3. el1.type = 'text';
  4. el1.name = 'date_from' + iteration;
  5. el1.id = 'datepicker';
          
  6. cell1.appendChild(el1);
 
The html is created fine, however the id is not being found for the datepicker function when creating the element dynamically.  when i manually insert a text box and give it the datepicker id, it works great.
  1. $(function() {
  2. $("#datepicker").datepicker();
  3. $.datepicker.setDefaults($.datepicker.regional['']);
  4. });
Any help would be great here --
 
thanks!