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

115
Views
mostrar alerta si está marcada la casilla de verificación con diferente attr en javascript

En mi proyecto, necesito verificar si los valores de la fila de identificación de datos son iguales a los valores de la fila de identificación de datos de las filas de la tabla verificada cuando las casillas de verificación están marcadas, devolver un valor si es igual y un mensaje si es no es igual. Enséñalo.

estas son mis filas

 <table> <thead> <tr> <th> <input type="checkbox" name="id[]"> </th> <th> first name </th> <th> last name </th> </tr> </thead> <tbody> <tr id="6"> <td><input type="checkbox"></td> <td>hamid</td> <td>hamidi</td> </tr> <tr id="7"> <td><input type="checkbox"></td> <td>john</td> <td>tyler</td> </tr> <tr id="8"> <td><input type="checkbox"></td> <td>john</td> <td>smith</td> </tr> </table>

¿Cómo puedo hacer eso?

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

0

Pruebe esto, le mostrará las identificaciones de todas las filas marcadas:

 var trs= document.getElementsByTagName("tr"); for (var i = 0; i < trs.length; i++){ var tr = trs[i]; var checks = tr.getElementsByTagName("input"); if (checks.length > 0 && checks[0].checked) alert(tr.id) }
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!