title: jquery load append datepicker function
body: <p>I have the following function that produces numbered input fields with <code>id</code>s and <code>name</code>s of the current timestamp they're were created. I'm trying to attach a datepicker to each one created, hence the unique/timestamp id's. </p>
  
  <p>Can anybody suggest a way for me to go about doing this? </p>
  
  <p>I believe the datepicker function needs to be produced under each input field created but I don't know how to produce a JavaScript function with JavaScript. I'm thinking maybe I can use jQuery's <code>load()</code> function and call a PHP script that produces a unique function and loads it into a div. Is that the best way to tackle this? Thanks!</p>
  
  <pre><code>&lt;script&gt;
      var number = 0;
      var num;
      $('#add_date').click(function(event) {
      number++;
      var d=new Date();
      var year = d.getFullYear();
      var day = d.getDate();
      var month = d.getMonth() + 1;
      if (month&lt;10){var month = "0"+month;}
      if (day&lt;10){var day = "0"+day;} 
      var fullyear = month+"/"+day+"/"+year;
      num = event.timeStamp
      $('#box').append( number+". &lt;input type='text' id='" + num + "' name='" + num + "' value='"+ fullyear + "' size='10'/&gt;&lt;br&gt;&lt;br&gt;");
      var idtag = "#"+num;
  });
  &lt;/script&gt;
  </code></pre>