diff --git a/js/slider.js b/js/slider.js new file mode 100644 index 0000000..4a371ce --- /dev/null +++ b/js/slider.js @@ -0,0 +1,14 @@ +function initializeSlider() { + const slider = document.getElementById("countSlider"); + const display = document.getElementById("sliderValueDisplay"); + + display.innerText = slider.value; + slider.addEventListener("input", function () { + display.innerText = this.value; + }); +} + +function getSliderValue() { + const slider = document.getElementById("countSlider"); + return parseInt(slider.value); +} \ No newline at end of file