Answers for "slider in html"

3

create a slider

<input className="newpost-rating-slider" type="range" name="rangeInput" 
min="0" max="5" onChange={handleSliderRating} />

<span className="slider-rating-field">0/5</span>



const handleSliderRating = () => {

        var curVal = document.querySelector('.newpost-rating-slider').value;
        var sliderRatingEle = document.querySelector('.slider-rating-field');

        sliderRatingEle.textContent =   curVal.toString() + "/5";
    
    }
Posted by: Guest on August-01-2020
0

slider html

var slideIndex = 0;
showSlides();

function showSlides() {
  var i;

    var slides = document.getElementsByClassName("mySlides");
  
for (i = 0; i < slides.length; i++) {
Posted by: Guest on August-04-2021

Browse Popular Code Answers by Language