Closed yesnice closed 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; });
Unsure as to why the event listener doesnt work