// Clearing Textarea
$('textarea').focus(function() {
var $this = $(this);
$.data(this, 'img', $this.css('background-image'));
$this.css('background-image', 'none');
});
$('textarea').blur(function() {
if($.trim($('textarea').val()).length){
$this.css('background-image', 'none');
} else {
$(this).css('background-image', $.data(this, 'img'));
}
});
当我单击文本区域时,尽管其中存在内容,但我仍然看到背景图像。
谢谢你的帮助!