Código:
<html> <head><title>Examen UNO</title> <script type="text/javascript"> function calcular(){ var n1 = parseInt(document.getElementById("n1").innerHTML); var n2 = parseInt(document.getElementById("n2").value); var n3 = parseInt(document.getElementById('n3').value); var n4 = parseInt(document.getElementById('n4').value); var n5 = parseInt(document.getElementById('n5').value); var n6 = parseInt(document.getElementById('n6').value); var des = n6 *0.3; var n6 = n6 - des; var to = n1 + n2 + n3 + n4 + n5 + n6; alert(to); } </script> </head> <body> <form> Enero <input type="text" name="n1" /><br /> FEB <input type="text" name="n2" /><br /> MAR <input type="text" name="n3" /><br /> ABR <input type="text" name="n4" /><br /> MAY <input type="text" name="n5" /><br /> JUN <input type="text" name="n6" /><br /> <input type="button" value="Total" onclick="calcular();" /> </form> </body> </html>