title: jquery datepicker multiple inputs
body: <p>I have an issue which related to multiple jquery process and datepicker.</p>
  
  <p>I am trying to create input dynamically so I wrote the code:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
  function season_func(){
      var series_season = $("input[name='series_season']").val();
      var i;
      $('.forms').html('');
      if(series_season&gt;30){
          series_season = 30;
      }
      for(i=0;i&lt;series_season;i++){
          var newTextBoxDiv = $(document.createElement('div'))
           .attr("id", 'seasonId' + series_season);
          newTextBoxDiv.after().html('&lt;label&gt;Sezon #'+ (i+1) + ' Başlangıç Tarihi : &lt;/label&gt;' +
            '&lt;input type="text" class="form-control datepicker" name="textbox' + (i+1) + 
            '" id="textbox' + (i+1) + '" value="" &gt;');
          newTextBoxDiv.appendTo(".forms");
      }
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>This create input when I call the season_func and It works properly.</p>
  
  <p>However when I add the datepicker It doesn't show the datepick.</p>
  
  <pre><code>&lt;script&gt;
      $(function() {
          $( ".datepicker" ).datepicker();
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>Normally, I create one input when application is started</p>
  
  <p><img src="https://i.stack.imgur.com/7c9A9.png" alt="Works fine when it started"></p>
  
  <p>If I add one button it doesn't appear.</p>
  
  <p><img src="https://i.stack.imgur.com/IwHfW.png" alt="Doesn&#39;t work properly."></p>
  
  <p>Best Regards.</p>