Evento onclick no ejecuta
Publicado por Juan Manuel Castañeda (6 intervenciones) el 09/02/2008 00:15:45
¿Por que no ejcuta el evento onclick del botón?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<meta name="author" content="">
<script type="text/javascript">
function F(var valor){
if (valor>1)
document.write('<br>')
switch (valor){
case 1:
return 1;
break;
case 2:
return F(--valor);
break;
default:
if (valor<1) {
document.write('Error' & valor & "Deber ser Natural");
} else {
return F(--valor)+F(valor-=2);
}
}
}
</script>
<title>Serie de Fibonacci</title>
</head>
<body>
<form name="form1">
<input type="text" name="valor">
<input type="button" name="Calcular" onclick="document.write(F(form1.valor.value))">
</form>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<meta name="author" content="">
<script type="text/javascript">
function F(var valor){
if (valor>1)
document.write('<br>')
switch (valor){
case 1:
return 1;
break;
case 2:
return F(--valor);
break;
default:
if (valor<1) {
document.write('Error' & valor & "Deber ser Natural");
} else {
return F(--valor)+F(valor-=2);
}
}
}
</script>
<title>Serie de Fibonacci</title>
</head>
<body>
<form name="form1">
<input type="text" name="valor">
<input type="button" name="Calcular" onclick="document.write(F(form1.valor.value))">
</form>
</body>
</html>
Valora esta pregunta


0