JSFiddle - React, Tailwind, and code Playground

HTML

<input type='range' id="input"/>
    <input type="button" onclick="changeColor();" value="Click here"/>

CSS

input[type=range] {
    -webkit-appearance: none;
    background-color: silver;
    width: 200px;
    height:20px;
}

input[type="range"]::-webkit-slider-thumb {
     -webkit-appearance: none;
    background-color: #666;
    opacity: 0.5;
    width: 10px;
    height: 26px;
}

JavaScript

function changeColor(){
document.getElementById("input").style.backgroundColor = '#000000';
}