$(".QuesComment").each(function(){
$(this).val('请输入100字以内的评语').css('color','#666666');
$(this).focus(function(){
$(this).css('color','#000');
if(!this.initValue){
this.initValue = this.value;
}
if(this.value === this.initValue){
this.value = '';
}
}).blur(function(){
if(this.value === '' || this.value === null){
this.value = this.initValue;
$(this).css('color','#666666');
}
});
})
相关文章:
- 文本框获得焦点后文本框内的提示文本消失 失去焦点后如果没有输入再显示提示 转 2021-11-10
- jQuery表单Input文本框默认说明文字获得焦点后消失效果 2022-12-23
- JS之文本框获得焦点和失去焦点 2022-12-23
- 文本框默认显示的字(提示的文字),点击后文字消失。 2022-12-23
- 文本框 获取焦点 失去焦点 实时监听 2022-12-23
- jquery插件小试牛刀:文本框为空时默认文字显示,获得焦点后默认文字消失 2021-11-28