Ver Mensaje Individual
  #5 (permalink)  
Antiguo 23/11/2008, 13:50
Avatar de salbatore
salbatore
 
Fecha de Ingreso: abril-2007
Ubicación: Springfield
Mensajes: 1.567
Antigüedad: 17 años, 1 mes
Puntos: 19
Respuesta: Borrar letra a letra

Hola!...

He probado la funcion de _eNGeLs_ pero no he podido hacerla funcionar... jeje... No hace nada, jeje... me da como error:

substring is not defined
comeletras()file:loc...ed-2.html (line 20)
(?)()()


¿Sabeis que es?, os dejo el codigo completo:


Dejo el codigo completo:

Código HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Untitled Document</title>
<script>
	window.onload = function()
		{
			var div_elegido = document.getElementById("div_elegido");
			div_elegido.onclick = function() 
				{
					comeletras();
				}						
		}
function comeletras() 
    {
        var div_elegido = document.getElementById("div_elegido");
        len = div_elegido.length - 1;
		div_elegido.style.color='#FF0000';
        div_elegido = substring(0, len);
        document.getElementById("div_elegido").innerHTML=div_elegido;
    }
</script>
</head>

<body>
<div id="div_elegido" >
asdfasdfas asdfasdf asdf asdf asdf asdf asdf asdf asdf asdf asdf 
</div>
</body>
</html>