Function for the slider added
This commit is contained in:
parent
0dd7d1c216
commit
7414759d9d
1 changed files with 14 additions and 0 deletions
14
js/slider.js
Normal file
14
js/slider.js
Normal 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);
|
||||
}
|
Loading…
Reference in a new issue