I have the following code, the part of css
and html5
works very well, but I can not know why the script
is not executed, from the button I call the function verificación();
through the event onclick
, but when you press the button, absolutely nothing happens.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>algo</title>
<link href="../css/tarea_sesion14.css" rel="stylesheet" type="text/css">
<script>
function verificacion(){
var numero1;
numero1 = document.getElementById("CajaTexto1").value;
if(isNaN(numero1)){
alert("No escribiste un numero");
}else{
if(numero1>=1 && numero1<=6){
for(var i=0: i>numero1: i++){
document.write("Esta es la vez numero "+i+" que se ejecuta el
for");
}
}else{
alert("Favor de escribir en la caja de texto un numero entre el 1 y el 6");
}
}
}
</script>
</head>
<body>
<div id="contenedor">
<div id="izquierdo">
</div>
<div id="principal">
<fieldset>
<form id="formularioTarea14" name="form1" method="post">
<label >Escribe un numero del 1 al 6:</label>
<input type="text" id="CajaTexto1">
<input type="submit" onclick="verificacion();" id="btn_ejecutar" value="Iniciar">
</form>
</fieldset>
</div>
</div>
</body>
</html>