Ver Mensaje Individual
  #2 (permalink)  
Antiguo 09/09/2012, 22:22
gebremswar
 
Fecha de Ingreso: enero-2012
Ubicación: Santiago de Surco, Lima - Perú
Mensajes: 266
Antigüedad: 12 años, 3 meses
Puntos: 57
Respuesta: Evento mientras se escribe en un input

Hola mgocx, que tal.

Código Javascript:
Ver original
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <script src="http://code.jquery.com/jquery-latest.js"></script>
  5. </head>
  6. <body>
  7.   <input type="text">
  8.   <p></p>
  9. <script>
  10. window.onload = (function(){
  11. try{
  12.     $("input").on('keyup', function(){
  13.         var value = $(this).val().length;
  14.         $("p").html(value);
  15.     }).keyup();
  16. }catch(e){}});
  17. </script>
  18. </body>
  19. </html>

La estrella esta noche es length.

Consulta http://api.jquery.com/