Tasha53505 / 159.356-capstone-project-group

4 stars 0 forks source link

Slider value not updating #90

Closed yesnice closed 1 month ago

yesnice commented 2 months ago

Unsure as to why the event listener doesnt work

yesnice commented 1 month ago

Current issue is that the text content itself isn't visibly updating. JS thinks that it is as this accurately prints the value of the slider

document.addEventListener("DOMContentLoaded", function(){ document.body.addEventListener('input', function(e){ if(e.target && e.target.id == "itemsPerPage"){ console.log(e.target.value); const perPageValue = document.querySelector("#itemsPerPageValue"); if(perPageValue){ console.log("Exists"); } else { console.log("Doesnt"); } console.log(perPageValue.textContent); perPageValue.textContent = e.target.value; } }); const perPageInput = document.querySelector("#itemsPerPage"); const perPageValue = document.querySelector("#itemsPerPageValue"); perPageValue.textContent = perPageInput.value; });