Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

314
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda