Question

How do I check if there's any content in <textarea> ? I need to addClass based on that condition.

Many thanks

Was it helpful?

Solution

if($.trim($('textarea').val()).length){
     $(this).addClass('someclass');
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top