Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

211
Vistas
Why I have not a number (NaN) output and not correct number

How can I solve that NaN problem, I always get NaN on iva10 value when I enter numbers in form.

function sum() {
  var num1 = parseFloat(document.getElementById('bene_significativo').value);
  var num2 = parseFloat(document.getElementById('manodopera').value);
  var num3 = parseFloat(document.getElementById('mark_up').value);

  document.getElementById('tot1').value = num1;
  document.getElementById('tot2').value = num2 + num3;
  document.getElementById('tot3').value = num1 + num2 + num3;

  var iva10 = document.getElementById('iva10').value = num1 - tot2;
}
Bene significativo: <input type="text" id="bene_significativo" class="form-control" placeholder="Valore del bene significativo" aria-label="bene significativo" /><br />
Manodopera: <input type="text" id="manodopera" class="form-control" placeholder="Default input" aria-label="mandopera" /><br />
Mark-up: <input type="text" id="mark_up" class="form-control" placeholder="Default input" aria-label="mark_up" /><br />
<br />
<div><button class="btn btn-primary" onclick="sum()">Calcola</button></div>
<br />
Bene significativo: <input type="text" value="" id="tot1" /><br />
Manodopera: <input type="text" value="" id="tot2" /><br />
Totale complessivo prestazione: <input type="text" value="" id="tot3" /><br />
IVA 10%: <input type="text" value="" id="iva10" /><br />
IVA 22%: <input type="text" value="" id="iva22" />

I've also tried :

var iva10 = parseFloat(iva10);

but without success.

Thanks in advance for your reply

almost 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda