I'm using jQuery UI 1.12. I have an input field that I turn into an autocomplete select using the code
$("#myFilter").autocomplete({source: myItems});
I then auto-select an item upon initialization using
$("#myFilter").autocomplete("search", defaultValue);
My question is, how do I get the selected ID of the item that's selected? If I were in an "onchange" event, I could do
$( "#myFilter" ).on( "autocompleteselect", function( event, ui ) {
var id = ui.item.value;
However, I am not in the onchange event, and as such I'm not sure how to extract the selected value.