I have few autocomplete on my page, but i have a problem, everything is working ok, but the problem is that i dont know how may #ID i will have, maybe i can make a function and make some array with ID that way i can easy maintain the code, this is whta i have for now?

```
  $('#autocomplete-1').autocomplete({
            source: autocompleteDataSource,
            minLength: 3,
            delay: 800,
            appendTo: '#auto-complete-1',
            select: autocompleteOnSelect,
            open: function () {
                setTimeout(function () { $("#ui-id-1").show(); }, 100);
            },
            response: function (event, ui) {
                if (ui.content.length === 0) {
                    $(this).val("No results found");
                } else {
                    $(this).empty();
                }
            }
        });
        $('#autocomplete-2').autocomplete({
            source: autocompleteDataSource,
            minLength: 3,
            delay: 800,
            appendTo: '#auto-complete-2',
            select: autocompleteOnSelect,
            open: function () {
                setTimeout(function () { $("#ui-id-2").show(); }, 100);
            },
            response: function (event, ui) {
                if (ui.content.length === 0) {
                    $(this).val("No results found");
                } else {
                    $(this).empty();
                }
            }
        });
        $('#autocomplete-3').autocomplete({
            source: autocompleteDataSource,
            minLength: 3,
            delay: 800,
            appendTo: '#auto-complete-3',
            select: autocompleteOnSelect,
            open: function () {
                setTimeout(function () { $("#ui-id-3").show(); }, 100);
            },
            response: function (event, ui) {
                if (ui.content.length === 0) {
                    $(this).val("No results found");
                } else {
                    $(this).empty();
                }
            }
        });

```

Need to make all ID in array and then loop into function?