Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

158
Vistas
How can i do a checkbox filter in javascript

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

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

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.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda