title: Passing an array value into the jQuery selector method?
body: <p>At the moment in my JS I statically define which input ID's I want to associate my datepicker script with.</p>
  
  <p>Like so:</p>
  
  <pre><code>$('datepicker1').glDatePicker();
  </code></pre>
  
  <p>However to make this dynamic I have refactored this into a for loop so that for multiple fields that need a datepicker I can call them in that loop.</p>
  
  <pre><code>dateArray[y] =  "datePicker" + i;
  //out of loop scope
  
  for (i = 0; i &lt; dateArray.length; i++)
      {
          $(dateArray[i]).glDatePicker();
  
      }
  </code></pre>
  
  <p>It does not seem to work , I have checked that there are values in the array by printing the values to the log.</p>
  
  <p>Is this a limitation of jQuery?</p>
  
  <p>Thanks</p>