noUiSlider, on update

hello guys, I'm trying to update an input when I update the slider value with its handle.

here is the JS:

//slider initialisation:

-------------------------------------------------------------------

var html5Slider = document.getElementById('html5');

noUiSlider.create(html5Slider, {

    tooltips: [true],

    start: [10],

    connect: false,

    range: {

        'min': -20,

        'max': 40

    }

}); 

-----------------------------------------------------------


now I'm trying to use the 'update' event to update the value of my input box:


----------------------------------------------------------------

html5Slider.noUiSlider.on('update', function (values,handle) {

var value = values[handle];


document.getElementById('input').value = value;

})

-----------------------------------------------------------------


I have spent quite a few hours trying to figure out what's wrong with my code.I would really appreciate your help. thank you very much

Answers 1

Related Articles