March 14, 2012
Cut down a string in text area within particular limit in jquery
Question by Benedict Peter
I have a text area in my user description form . I need to cut down the string , if user enter more than 100 chars. I want to use jquery for this
Answer by duke
simply use this
$('#textarea').bind('keyup', function() {
$('#textarea').val($('#textarea').val().slice(0, 100));
});