Function for the slider added

This commit is contained in:
Ramses Revengeday 2024-11-15 21:57:02 +00:00
parent 0dd7d1c216
commit 7414759d9d

14
js/slider.js Normal file
View file

@ -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);
}