Sometimes I need to know if an input field already has autocomplete bound to it. I haven't found any other way to do this other than:
$input.hasClass('ui-autocomplete-input')
Then I discovered that elements with autocomplete has an attribute like this:
<input autocomplete="off">
This however never seems to be set to on, and I can't find any documentation about this attribute.
Question: What is the best/correct way to check if autocomplete has been bound to an element?
you can also use the data property
var check = $input.data('ui-autocomplete') != undefined;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With