Closed britnay268 closed 8 months ago
Will need to create an eventListener to listen for clicks on buttons.:
Potential code for filterButtons
const filterBtns = document.querySelector("#filterBtnsConatiner"); filterBtns.addEventListener("click", (e) => { // console.log(e.target.id) if (e.target.id === "all") { studentsOnDom(data); } else if (e.target.id) { const card = data.filter((c) => c.house.toLowerCase() === e.target.id); studentsOnDom(card); } });
My potential code mentioned above is far from what I actually did.
Will need to create an eventListener to listen for clicks on buttons.:
Potential code for filterButtons