How to get element attributes onAutocomplete with Materialize
问题 I am using the same Materialize Autocomplete on 3 input elements. Then on onAutocomplete() I need to get the ID of the element the autocomplete was used on so I can populate data in the right place. So I want to know if it was either autocomplete-input1 or autocomplete-input2 . How can I do that in pure javascript? <div class="col s12"> <div class="row"> <div class="input-field col s6"> <input type="text" id="autocomplete-input1" class="autocomplete" autocomplete="off"> <label for=