Day # 24: Range Slider



Generally speaking, input elements are fairly complicated to style. However, that doesn’t mean we should neglect this task. On the contrary, it is our duty as frontend developers to take care of the styling of these elements, especially if our website is filled with information that is entered by its visitors.

That’s why I decided to style an input[type=”range”] for today’s website. I’m not going to go into detail about the styling per se. I strongly recommend you to look for guides online in which they explain, step by step, all the details involved in this task.


I rather think it’s more important to explain how we can handle the changes in that input, meaning when the visitor clicks on the small ball in the slider and moves from left to right. To achieve that, we only need to select the value on that input and show it in another div that is in charge of displaying said value:

sliderValue.textContent = mySlider.value; 

Comments

Popular posts from this blog

Day # 19: Checkbox animation

Day # 12: Typewriter Effect

Day # 53: Icon text