First Off, HTML5 fully supports the placeholder attribute for input && textarea.
Secondly, for older versions, there is a very simple jQuery Plugin Here that manages between HTML5 and other HTML's. In other words, if your browser supports HTML5, it won't do anything. Just use the placeholder attribute in your HTML markup and let the plugin do the work.
Third, if you're ever in question which value to pull on something like that, try using an or switch, such as var val = $(this).val() || $(this).text(). Just note, this could lead to improper results if what you WANT is on other side of or, but the first evaluates true.
Finally, If you don't want that plugin, I still suggest using the placeholder attribute and the following JavaScript:
HTML
<textarea id="a" placeholder="text are text?"></textarea>
JS
$(document).on('blur focus', '[placeholder]', function(e) {
var val = $.trim($(this).val() || $(this).text()), // remove use of .trim here if you WANT to ALLOW text are to be a blank space like " "
placeHolder = $(this).prop('placeholder');
switch(e.type) {
case 'focusin':
if (val == placeHolder) $(this).val('').text('');
break;
case 'focusout':
if (val == '') $(this).val(placeHolder).text(placeHolder);
break;
}
});
// the following will make sure all fields having placeholder will start with placeholder in place
$('[placeholder]').each(function(i) { $(this).text($(this).prop('placeholder')); });
See Working Example Here
NOTE
I dont think $(this).val() || $(this).text() might work in some older versions of IE, thus you may need to actually distinguish, thus writing a longer if statement. I simply sought to show shortest answer here. If you need more cross browser compatibility to OLDER browsers, I really suggest the Plugin that has already done all of this work for you.