You can change the color of the search results box by changing the style of the search results via CSS div #ui-id-1
, which is the div
default of the plugin results:
<style>
#ui-id-1{
background: red; /*fundo vermelho*/
}
</style>
Example:
$( function() {
var availableTags = [
"ActionScript",
"AppleScript",
"Asp",
"BASIC",
"C",
"C++",
"Clojure",
"COBOL",
"ColdFusion",
"Erlang",
"Fortran",
"Groovy",
"Haskell",
"Java",
"JavaScript",
"Lisp",
"Perl",
"PHP",
"Python",
"Ruby",
"Scala",
"Scheme"
];
$( "#tags" ).autocomplete({
source: availableTags
});
} );
#ui-id-1{
background: red;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css">
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<div class="ui-widget">
<label for="tags">Tags: </label>
<input id="tags">
</div>
As to the div
unwanted, you can inspect in the browser and pick up the class or id
and hide in CSS via display: none
.
You don’t show up the div with the search results?
– Sam
I put another image, notice that when I select a value it adds a div below the form. That div I don’t want to appear
– Diego Grossi
I didn’t understand. Which div?
– Sam
It would be good if you put the code of how you are doing this, because the plugin does not have these buttons that you put in the image.
– Sam
the buttons are from the application, I am using the ui only for the autocomplete. All the customization of the site is done with bootstrap
– Diego Grossi
Yes, but which div do you refer to? You say that empty space below the input?
– Sam
The text with the name of the city that is appearing below the for. Look, I selected "River of accounts" and he copied what’s in the input and created a div below the form with that value. But that’s the least, I really want to be able to put a background color in the box that appears the autocomplete suggestions
– Diego Grossi