Hi I'm trying to add a label to the range slider I had tried using options but it is not working.
- How can I make range value 100% it is showing an overall 4% because of
Max="4"i want to increase 25% every slide and make it 100% in 4 steps Can anyone suggest to me how do I add a label to the range slide.
var slider = document.querySelector('#slider');
function range_change_event() {
var percent = slider.value;
lbl.textContent = percent + '%';
}
slider.addEventListener('input', range_change_event);
<input id="slider" type="range" min="1" max="4" step="0" list="volsettings" />
<label id="lbl" id="value" for="slider">0%</label>
<datalist id="volsettings">
<option>0</option>
<option>1</option>
<option>2</option>
<option>3</option>
</datalist>
</div>
