Ver Mensaje Individual
  #2 (permalink)  
Antiguo 30/01/2010, 15:58
Avatar de alor86
alor86
 
Fecha de Ingreso: abril-2009
Mensajes: 110
Antigüedad: 15 años
Puntos: 5
De acuerdo Respuesta: Generar textbox a partir de un evento

prueba con esto
Código Javascript:
Ver original
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3.  
  4. <head>
  5.     <meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
  6.     <meta name="author" content="">
  7.  
  8.     <title></title>
  9.     <script type="text/javascript">
  10.         var id = 0;
  11.         function crearText(){
  12.             id++;
  13.             var nuevoText = document.createElement('input');
  14.             var elDiv = document.getElementById('cont');
  15.             nuevoText.setAttribute('type','text');
  16.             nuevoText.setAttribute('id','t'+id);
  17.             nuevoText.onblur = crearText;
  18.             elDiv.appendChild(nuevoText);
  19.            
  20.         }
  21.     </script>
  22. </head>
  23.  
  24. <body>
  25.     <div id="cont">
  26.         <input type="text" id="t0" onblur="crearText()">
  27.     </div>
  28.  
  29.  
  30.  
  31. </body>
  32. </html>