Yuki Lun• 190
@yukilun
Posted
Hi!👋 For changing the progress bar color, you can add a event listener to listen for the input event of #myRange
and change the background of #myRange
with linear-gradient
property based on its value:
myRange.addEventListener('input', (e) => {
const percent = e.target.value / 1000 * 100;
myRange.style.background = `linear-gradient(to right, hsl(188, 100%, 82%) ${percent}%, hsl(180, 2%, 84%) ${percent}%)`;
});
Hope you find it helpful!😊
0
SRI RAKESH V• 590
@srirakeshv
Posted
Thankyou so much for your help @yukilun
0