I am willing! And since it is completely different from the first abro as another answer:
You do not need to use jQuery: use CSS3 and, if you need to, Vanilla JS or its equivalent in jQuery:
Show text while textarea has focus does not need JS: ( jsbin )
#showedText {
opacity: 0;
transition: opacity 1s 1s;
}
#myTextarea:focus + #showedText {
opacity: 1; transition-delay: 0;
}
Show text while textarea is being edited uses little JS: ( jsbin )
#showedText {
opacity: 0;
transition: opacity 1s 1s;
}
#showedText.editing {
opacity: 1; transition-delay: 0;
}
JavaScript used - Vanilla JS:
var myTextarea = document.getElementById('myTextarea');
var showedText = document.getElementById('showedText');
myTextarea.addEventListener('keydown', function () {
showedText.className += ' editing ';
setTimeout(function () {
showedText.className = showedText.className
.replace(/(^|\b)editing(\b|$)/g, '');
}, 500);
});
JavaScript used - jQuery or Zepto:
var showedText = $('#showedText');
$('#myTextarea').on('keydown', function () {
showedText.addClass('editing');
setTimeout(function () {
showedText.removeClass('editing');
}, 500);
});
Editing: As I wrote this code wall other people ventured into using CSS3, so I leave a tip to the author: use prefixfree .