I have a HTMLElement with lots of things going on inside it. One of those things is a range slider with an id of 'slider-1'.
I want to change a value (some variable) in the event sheet when this slider has been changed. I can see there is a htmlElement onClicked event for buttons which works great, but I can't find anything for a slider.
How would I do this?
I tried the following javascript snippet. It does nothing but I have a feeling I might be on the right track ...
var slider = document.getElementById("slider-1");
var textElement = document.getElementById("val-1");//a text element to display the current value
slider.addEventListener("input", function() {
var sliderValue = this.value;
textElement.textContent = sliderValue;
});