Código: Seleccionar todo
<html>
<head>
<script>
//Ejemplo de contador by linkgl respeta este comentario
var segundos=11; //seteamos el contador a 10 + 1
function restar()
{
segundos--; //restamos 1 al contador
if(segundos==10) //si acabamos de iniciar
var restando=setInterval(restar,1000); //entonces creamos un intervalo de 1000 milisegundos
if(segundos>=0) //si somos mayor o igual a 0 entonces mostramos los segundos faltantes
{
document.getElementById("contador").innerHTML='Espere ' + segundos + ' segundos.';
}
else //si no puesss ya terminamos de contar y mostramos el formulario xDDD
{
document.getElementById('contador').innerHTML='Se ha terminado de contar';
clearInterval(restando); //eliminamos el intervalo
}
//linkgl.
}
</script>
</head>
<body onLoad="restar();">
<div id="contador">
Linkgl
</div>
</body>
</html>