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

149
Views
I am trying to use a function in my project. But the console shows error

I am trying to add an event listener, but I am facing a problem in the console. Can anyone take a look at my code?

enter image description here

enter image description here

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Instead document.querySelectorAll which return a collection you have to use document.querySelector(). Then it would work.

But if you have multiple delete Buttons then use: document.querySelectorAll. Afterwards you must iterate this collection to add an EventListener to every element.


const btns = document.querySelectorAll('.delete');
btns.forEach(b => b.addEventListener('click', () => {
   // and action
}))
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!