Ver Mensaje Individual
  #3 (permalink)  
Antiguo 12/01/2010, 14:39
judamo
 
Fecha de Ingreso: diciembre-2008
Mensajes: 25
Antigüedad: 15 años, 5 meses
Puntos: 0
Pregunta Respuesta: por que no funciona es sencillo

ola javier, upss la verdad coloque una prueba, igual ya cambie la line a value y el navegador chrome sigue sin mostrar resultado, falta configurar algo en el navegador?
n1 es tan solo campo de texto..
Código:
<html>
<head><title>Examen UNO</title>
<script type="text/javascript">
function calcular(){

var n1 = parseInt(document.getElementById("n1").value);
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>