Reputation: 68780
How do I check if there's any content in <textarea>
? I need to addClass based on that condition.
Many thanks
Upvotes: 1
Views: 402
Reputation: 236192
if($.trim($('textarea').val()).length){
$(this).addClass('someclass');
}
Upvotes: 5