EDIT: onblur worked! Thanks!! 😀
A good example of this is facebook.com. When you click on the comment box the textarea size increases and the text “Write a comment” is removed. That I already know how to do.
The problem that arises for me is when a user (me) clicks away from that container div, the textarea goes back to the original settings.
What javascript method am I looking for?
You are looking for the
blurmethod.Here is an example (using jQuery):
http://jsfiddle.net/c747a/
And one without jQuery (although I would use jQuery):
http://jsfiddle.net/kxW3G/