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

308
Views
How can i change webkit-slider-thumb color using javascript?

I want to change the color of the input range and it works with CSS, But i want to change the color using javascript. Please help to fix this.

Working CSS

input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  background: goldenrod !important;
}

Javascript code

document.querySelector('.plyr--full-ui input[type=range]').style.setProperty('--plyr-range-thumb-background', 'green')

Any solution appreciated!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You're in the right direction with CSS custom properties (variables). Just change the background to the custom property and set its default color:

input[type='range']::-webkit-slider-thumb {
  --plyr-range-thumb-background: goldenrod;
  -webkit-appearance: none;
  background: var(--plyr-range-thumb-background);
}
about 4 years ago · Juan Pablo Isaza Report
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!