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

171
Views
¿Cómo asigno correctamente un precio y luego calculo el precio por cantidad? javascript

(el javascript está en un archivo separado para fines ordenados)

esta es la primera vez que publico una pregunta

estoy aprendiendo a crear un sitio web, tengo múltiples entradas en el html. También quiero generar el total tanto individualmente como todos juntos en una estimación en la parte inferior del sitio web.

individualmente ItemPrice * Cantidad;

todos juntos = precio total;

¿Espero que esto tenga sentido? ## Título ##


 // Calculating Function for Tier3 function price(Tier3) { var Tier1 = document.getElementById("Tier3");//Getting ID Tier3 = 1.4; var Tier1 = document.getElementById("Tier2");//Getting ID Tier2 = 1.6; var Tier1 = document.getElementById("Tier1");//Getting ID Tier1 = 1.8; var RAM = document.getElementById("RAM");//Getting ID RAM = 3.45; //assigning value var vCPU = document.getElementsByID("vCPU"); //Getting ID vCPU = 2.54; // assigning price? var price = parseFloat($('#price').text()) || 0; var qty = parseInt($('#quantity').val()); var total = price * qty; $('#total').text(total); }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Lo descubrí, gracias chicos!
// Función de cálculo para el precio de la función Tier3 () {

 var Tier3 = document.getElementById("Tier3");//Getting ID //Tier3 = 1.4; var Tier2 = document.getElementById("Tier2");//Getting ID //Tier2 = 1.6; var Tier1 = document.getElementById("Tier1");//Getting ID //Tier1 = 1.8; var RAM = document.getElementById("RAM");//Getting ID //RAM = 3.45; //assigning value var vCPU = document.getElementById("vCPU"); //Getting ID var totalPerItem = document.getElementById("totalPerItem") totalPerItem.innerHTML = "$" + ((vCPU.value * 2.54) + (RAM.value * 3.45) + (Tier1.value * 1.8) + (Tier2.value * 1.6) + (Tier3.value * 1.4)); // assigning price?

}

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!