I have the following: FIDDLE
The placeholder works fine and dandy until you type something, ctrl + A, and delete. If you do that, th
var placeholderCommentText = 'Comment...',
placeholderComment = $('#write_comment').attr('placeholder', placeholderCommentText);
$('#write_comment').text(placeholderCommentText);
$('[contenteditable]').bind({
focus: function(){
if ($('#write_comment').text().length == 0 || $('#write_comment').text() == $('#write_comment').attr('placeholder')) {
$(this).empty();
}
$(this).keyup(function(){
if ($('#write_comment').text() == $('#write_comment').attr('placeholder')){
$('#write_comment').attr('placeholder','');
} else if ($('#write_comment').text().length == 0 ) {
$('#write_comment').attr('placeholder', placeholderCommentText);
}
});
},
focusout: function(){
if ($('#write_comment').text().length == 0) {
$(this).text($(this).attr('placeholder'));
}
}
});