Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
103
rated 0 times [  110] [ 7]  / answers: 1 / hits: 17433  / 11 Years ago, wed, august 28, 2013, 12:00:00

How can I change the color of my slider from



<input type=range id=input>


I already tried color, bg-color and background-color and it won't change...



UPDATE:



I wanna change it with javascript. Something like this:



document.getElementById(input).style.background-color = 000000;

More From » css

 Answers
32

Try this:



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;
}

document.getElementById(input).style.backgroundColor = '#000000';


jsfiddle


[#76064] Tuesday, August 27, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
leslijessalyng

Total Points: 650
Total Questions: 85
Total Answers: 109

Location: Croatia
Member since Mon, Sep 6, 2021
3 Years ago
leslijessalyng questions
Fri, Feb 21, 20, 00:00, 4 Years ago
Tue, Jul 30, 19, 00:00, 5 Years ago
Fri, Jul 5, 19, 00:00, 5 Years ago
Wed, Mar 13, 19, 00:00, 5 Years ago
;