2 回答
TA贡献1795条经验 获得超7个赞
请检查一下,希望它能起作用:-)
var slider = document.getElementById("myRange");
var output = document.getElementById("dynamicSet");
var isShow = true
output.innerHTML = slider.value
update=()=>{
output.innerHTML = slider.value;
// Display the default slider value
console.log(slider.value)
}
// Update the current slider value (each time you drag the slider handle)
//let update = () => output.innerHTML = slider.value;
slider.addEventListener('input', update);
<div class="slidecontainer">
<p>Aantal sets: <span id="dynamicSet"></span></p>
<input type="range" min="1" max="10" value="50" class="slider" id="myRange">
</div>
TA贡献1829条经验 获得超7个赞
你可以试试这个
let update = () => {
output.innerHTML = slider.value;
console.log(slider.value)
}
- 2 回答
- 0 关注
- 100 浏览
添加回答
举报