I need to make a checkbox filter by categories. This is what I have so far, but I don't know how to follow the logic:
const procesadores = d.querySelector(".procesador");
procesadores.addEventListener("click",()=>{
if(procesadores.checked == true){
d.querySelectorAll(".card").forEach((el) => el.textContent.includes(procesadores.value));
} else {
console.log("unchecked")
}
})
Each product card has the card class, I need them to be shown or hidden depending on whether the checkbox is activated or not
If you want to do from scratch (just with js) then I suggest you to bind an onChange event on your checkbox (for e.g categorieA) and in the handler event select all your html Element which have the right class and turn on visible.