0

I have create a chrome extension to autocomplete forms.

The code I'm using to autocomplete is basically the once from this site

$( 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
    });
  } ); 

It does its job, but I'm having issues to read the suggestion because the background is transparent as shown in the below image:

enter image description here

Is it possible from the extension to set a solid white background color?

EDIT:

I'm trying to change it as suggested. This changes work:

document.querySelector("[id='tags']").style.color="Red"
document.querySelector("[id='tags']").style.backgroundColor="Red"

But that only changes the text box:

enter image description here

And I want to chang the background on the options only.

I tried this one:

document.querySelector("[id='tags']").background-color =  "Red"

And got the following error:

Uncaught SyntaxError: Invalid left-hand side in assignment
Luis Ramon Ramirez Rodriguez
  • 9,591
  • 27
  • 102
  • 181
  • 1
    I don't know that plugin but for the standard Chrome'a autocomplete it's different, see [Google Chrome form autofill and its yellow background](https://stackoverflow.com/q/2920306) – wOxxOm May 29 '20 at 05:36

1 Answers1

1

the website you have referenced adds <ul> when showing autocomplete. You need to add a css for ul to have a background-color. So the following code works for me.

  ul#ui-id-1 {
   background-color: red;
  }
mkamranhamid
  • 583
  • 4
  • 18