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

216
Views
expresión para sumar valores de una columna

La siguiente expresión (marcada entre ****) es parte del código de un sitio web que ofrece una lista de componentes de PC y te permite elegir las partes para crear tu propia PC... la cosa es que necesito recopilar cada elemento seleccionado pero no funciona.. Soy bastante nuevo en esto Y no se preocupen, no es una página real.. es un ejercicio, pero realmente quiero entender dónde está mi problema.

 let TotalsinIva = 0; let TotalFinal = 0; let iva = 0; ******************************** function sumafactura() { TotalSI = 0; let productos = document.getElementsByTagName("select"); for (let i = 0; i < productos.length; i++) { TotalSI += eval(productos[i].value); } ******************************** document.getElementById("Total").value = TotalSI.toFixed(2) + " €."; iva = (TotalSI * 18 / 100); document.getElementById("Iva").value = iva.toFixed(2) + " €."; TotalFinal = TotalSI + iva; document.getElementById("TotalTotal").value = TotalFinal.toFixed(2) + " €."; } function imprimir(){ text = ("<HEAD><TITLE>Factura de tu ordenador</TITLE></HEAD>"); text += "<BODY BGCOLOR='#FFFFFF'><B><FONT SIZE= 4 COLOR=BLUE>Factura desglosada de tu pedido.</FONT></B>"; text += "<br><hr>"; text += "<TABLE BORDER =0><TR VALIGN=Top><TD VALIGN=Top>"; text += "<B>Caja de Ordenador:<BR>Disco Duro: <BR>Teclado: <BR>Ratones: <BR>Placa base: <BR>Tarjetas de sonido:"; text += "<BR>Microprocesadores: <BR>Monitores: <BR>Tarjeta gráfica: <BR>Routers: <BR>Granadoras: <BR>Impresoras: "; text += "</B></TD><TD>"; let productos = document.getElementsByTagName("select"); for (let i = 0; i < productos.length; i++) { text += "<b>" + productos[i].value + " €." + "<br>"; } text = (text + "<br><br><CENTER><BUTTON onClick='window.print()'><img SRC='Imagenes/impre.gif' border='0' WIDTH='38' HEIGHT='34'></BUTTON>"); text = (text + "</body></html>"); msgWindow = window.open("", "displayWindow", "toolbar=no,width=375,height=480,directories=no,status=yes,scrollbars=no,resize=no,menubar=yes"); msgWindow.document.write(text); msgWindow.document.close(); }
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!