Ver Mensaje Individual
  #2 (permalink)  
Antiguo 10/07/2009, 20:06
Avatar de duskrow
duskrow
 
Fecha de Ingreso: abril-2008
Mensajes: 267
Antigüedad: 16 años, 10 meses
Puntos: 8
Respuesta: Capturar la posicion cuando hago click en un textarea

Cita:
function contador_text(){
var __permitido = 114 ;
var __texto_permitido = '' ;
var __texto = $("#texto").attr("value") ;
var __total = __permitido - __texto.length ;
var __array = new Array();
__array = __texto.split('');


for(i=0 ; i<__texto.length ; i++){

if( i <= __permitido){
__texto_permitido += __array[i] ;
}

}

$("#texto").html(__texto_permitido) ;

if(__total >= 0){
$("#faltantes").html(__total) ;
}
return false ;
}

es una funcion que desarrolle hace rato , requieres jquery