Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

156
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!