How can I do this in textarea
$(this).text() = $(this).text().substring(0, 20);
How can I do this in textarea
$(this).text() = $(this).text().substring(0, 20);
Always try to cache the selector in a var if you find yourself doing $(this) or $('#something') multiple times.
var $this = $(this);
$this.val( $this.val().substring(0, 20) );