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

195
Views
Object.click() no funciona para la etiqueta de etiqueta

Tengo un conjunto de datos que recorro y hago filas de casillas de verificación junto con otros datos. El usuario debe tener la capacidad de hacer clic en la casilla de verificación para alternar si se debe mostrar algo más. Por alguna razón, nunca se llama a $('label').click(). Código:

 let i = 0; data.forEach((row) => { myTable += "<tr>" + "<td>" + `<label id="label" for=` + String(i) + `><input type="checkbox" id=` + String(i) + `><span> Not showing</span></label>` + "</td>"+ "<td>" + row.name + "</td>" + "<td>" + app.nations[row.nation] + "</td></tr>" $('label').click(function() { console.log("Clicked"); var checked = $('input').is(':checked'); $('span').text(checked ? ' Showing' : ' Not showing'); }); i += 1; });

¡Gracias!

about 4 years ago · Juan Pablo Isaza
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!