Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

111
Views
How to add image to the Selected option in Select and how to change the options hover default color?

I am using the html "select"

const selectedvalue = "male"
<select>
    <option className={selectedvalue == "male" ? "selectedoption" : } selected={selectedvalue == "male" ? "selected" : false} value={"male"}>male</option>
    <option className={selectedvalue == "female" ? "selectedoption" : false} selected={selectedvalue == "female" ? "selected" : false}value={"female"}>female</option>
</select>

CSS Code:

.selectedoption{
   color: #DB1962;
   background-image: url("my base 64 code")
 }
 option:hover{
   background-color: "#FFF"  
 }

I am using the background color for option hover, but still i am getting the default background color on hover.

And on the Selected value with selectedoption class i can able to get the color but image i am not able to get I want the Tick icon to be displayed on the selected option.

Thanks in Advance.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!