If you want to write $(this)
you have to attach an event to the element. Looks like you need a keyup
event.
$('.text-edit1').keyup(function () {
if ($.trim($('.text-edit1').val()).length) {
$(this).addClass('active-text');
} else {
$(this).removeClass('active-text');
}
});