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

239
Views
Obtenga el valor numérico de td innerText

Esta es mi tabla:

 <!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>Documento senza titolo</title> <link href="Champions%20League/Champion%20League.css" rel="stylesheet" type="text/css"> </head> <body style="border-style: none; border-collapse: collapse; empty-cells: show; table-layout: auto; font-family:Verdana, 'Hoefler Text', 'Liberation Serif', Times, 'Times New Roman', serif"> <table ;="" style="width: 80%; text-align: center; margin-left: auto; margin-right: auto;" id="db" cellspacing="2" cellpadding="2" border="1"> <tbody> <tr> <td width="10%">09-11-1996</td> <td width="10%">Norimberga</td> <td style="text-align: right;" width="15%">Germania</td> <td width="10%">3-0</td> <td style="text-align: left;" width="15%">Irlanda del Nord</td> <td width="25%">Qualificazioni Mondiali 1998 </td> <td width="5%"><strong>1</strong></td> </tr> </tbody> </table> <script> function GetCellValues() { var table = document.getElementById('db'); var total = 0 for (var r = 0, n = table.rows.length; r < n; r++) { total += parseInt(table.rows[r].cells[7].innerText) } alert(total); } GetCellValues() </script> </body> </html>

La secuencia de comandos al final debe repetirse durante un cierto número de filas. Pero no puedo extrapolar el valor numérico presente en la última celda (en este caso, 1 ), ya que el valor final de la variable total es NaN . ¿Cómo puedo arreglarlo?

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!