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

145
Views
tratando de calcular celdas específicas de tablas con javascript sin el uso de id

Estoy tratando de calcular la celda 2 y la celda 3 de la tabla en cada fila en la que el resultado se mostrará en la celda 4 y la celda 4 se multiplicará por 1,96 para calcular la celda 5

 function Calculate() { let calc = document.getElementById("tblCalc").querySelectorAll("tr"); rows.cells [4] = rows[1,2,3,4,5].cells[3].value/1000*cells[2].value; rows.cells [5] = rows[1,2,3,4,5].cells[4].value*1.96; for (var i = 0 < calc.rows.cells; i++; ) { document.getElementById("result1").value; document.getElementById("result2").value = document.getElementById("result1").value*1.96; }

aquí hay 1 parte de mi html

 <table id="tblCalc"> <tr> <th>Ingredient</th> <th>Prijs per kilo</th> <th>Nodig voor de 25cm pizza in gram</th> <th>25cm pizza</th> <th>35cm pizza</th> </tr> <tr> <td><input type="text"></td> <td><input type="number"></td> <td><input type="number"> </td> <td><input type="number" readonly></td> <td><input type="number" readonly></td> </tr> <tr> <td><input type="text" ></td> <td><input type="text"></td> <td><input type="text" ></td> <td><input type="text" readonly></td> <td><input type="text" readonly></td> </tr> <input type="number" readonly id="result1"> <br> <input type="number" readonly id="result2"> <br> <button onclick="Calculate()">Calculate</button>
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!