I have struggled on this every single time, aaand again today. I am appending new text element and I want to bind autocomplete to it.
This code is in function with previous onClick
$('#highlights').before("<input type='text' id='check_name' name='name' placeholder='Name of OPM' required class='ui-autocomplete-input'>");
This autocomplete is on the end of the webpage
<script type="text/javascript">
$("#check_name").autocomplete({
source: "src/check_name.php",
minLength: 1
});
</script>
PHP file is working good when I access it via URL.