I use the jQuery combobox plugin:
https://jqueryui.com/autocomplete/#combobox
My JS:
$(function() {
$( "#combobox" ).combobox();
$( "#toggle" ).click(function() {
$( "#combobox" ).toggle();
});
});
My goal is to add a custom class to the autocomplete div in order to individually style the autocomplete dropdown. I already tried the following, but this is not working:
$( "#combobox" ).combobox().autocomplete("widget").addClass('my-custom-autocomplete-class');
ui-autocomplete
input
appended an insertedspan
. You can get it using$("#combobox").next("span").find("input")
. Of course, you could also go the none-insane-way and use the appropriate selector$(".custom-combobox-input")