title: Apply a library function to multiple inputs
body: <p>I'm using <a href="https://leaverou.github.io/awesomplete" rel="nofollow noreferrer">https://leaverou.github.io/awesomplete</a> to build an autocomplete suggester, i've modified the code a bit so that instead of inputting the text like tags they can write full sentences with each item as suggestion for the next word</p>
  <blockquote>
  <p>he</p>
  <p>hello m</p>
  <p>hello my na</p>
  <p>hello my name</p>
  </blockquote>
  <p>This is the code:</p>
  <pre><code>
  
  new Awesomplete('input[data-multiple]', {
  list: [&quot;hello&quot;, &quot;my&quot;, &quot;name&quot;, &quot;is&quot;, &quot;ari&quot;],
  filter: function (text, input) {
      return Awesomplete.FILTER_CONTAINS(text, input.match(/[^ ]*$/)[0]);
  },
  
  item: function (text, input) {
      return Awesomplete.ITEM(text, input.match(/[^,]*$/)[0]);
  },
  
  replace: function (text) {
      var before = this.input.value.match(/^.+ \s*|/)[0];
      this.input.value = before + text + &quot; &quot;;
  }
  });
  </code></pre>
  <p>Now this works but it only activates on the first input<code>input[data-multiple]</code>, whereas I have multiple inputs that I want to use the auto suggest on.</p>
  <p>eg.</p>
  <pre class="lang-html prettyprint-override"><code>&lt;label&gt;Name:&lt;/label&gt;
  &lt;input data-multiple /&gt;
  
  &lt;label&gt;Address:&lt;/label&gt;
  &lt;input data-multiple /&gt;
  
  &lt;label&gt;Mobile:&lt;/label&gt;
  &lt;input data-multiple /&gt;
  </code></pre>