Сделал такой ползунок, как добавить текст для имени ползунка?
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
.slidecontainer {
width: 100%;
}
.slider {
-webkit-appearance: none;
width: 500px;
height: 25px;
left: 710px;
top: 274.61px;
background: rgba(149, 82, 62, 0.2);
border-radius: 50px;
}
.slider:hover {
opacity: 1;
}
.slider::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 100px;
height: 25px;
left: 710px;
top: 274.61px;
background: #95523E;
border-radius: 50px;
}
.slider::-moz-range-thumb {
width: 25px;
height: 25px;
border-radius: 50%;
background: #4CAF50;
cursor: pointer;
}
</style>
</head>
<body>
<div class="slidecontainer">
<input name="f" type="range" disabled min="1" max="5" value="1" class="slider" id="myRange" >
<input type="range" disabled min="1" max="5" value="1" id="demo">
<span id="demo">
</div>
<script>
var slider = document.getElementById("myRange");
var output = document.getElementById("demo");
$('.slidecontainer').text('Hello').css({width:70,'text-align': 'center'});
output.innerHTML = slider.value;
slider.oninput = function() {
output.innerHTML = this.value;
}
</script>
</body>
</html>