//Similar to QQ to talk about limiting the number of characters entered in the text box, the KEYUP event is triggered
// Limit the number of characters entered in the text box $( "#saythings" ). keyup ( function (){ var len = $( this ). val (). length ; if (len > 2000 ){$( this ). val ( $( this ). val (). substring ( 0 , 2000 )) ; } var num = 2000 - len ; $( ".counter" ). text (num) ; }) ;