title: Twitter Typeahead set in loop uses first field's URL
body: <p>I have a typeahead initialisation function that gets all my typeahead fields and is supposed to set their remote URLs based on a data-url value. However for some reason, it's setting all fields to the first field's url. If I use the console to manually destroy all typeaheads and then target the second field individually, it STILL uses the first field's url. </p>
  
  <p>Using Typeahead 0.9.3</p>
  
  <pre><code>function setTypeaheadFields() {
      $.each($("[data-autocomplete]"), function() {
          let input = $(this);
          input.typeahead("destroy");
          let resultField = input.data('inputfield');
          let sourceUrl = input.data('url');
          let minLength = input.data('minLength') || 3;
          console.log(sourceUrl);
          input.typeahead({
              valueKey: 'text',
              name: 'text',
              minLength: minLength,
              remote: {
                  url: sourceUrl + '/%QUERY',
                  filter: function(parsedResponse) {
                      return parsedResponse;
                  },
              template: [
                  "&lt;p class='label'&gt;&lt;strong&gt;{{text}}&lt;/strong&gt;&lt;/p&gt;"
              ].join(''),
                  engine: Hogan
              }
          }).on('typeahead:selected typeahead:autocompleted', function(e, datum) {
              $(resultField).val(datum.id);
          }).on('typeahead:closed', function() {
              $(resultField).val('');
          });
      });
  }
  </code></pre>