javascript搜索框点击文字消失失焦时文本出现

当获焦时,文本消失,失焦时文本出现

无标题文档 var oText=document.getElementById("text"); var onoff=true; oText.color="#000"; oText.onfocus=function(){ if(onoff){ this.value=""; this.color="red"; onoff=false; } }

oText.onblur=function(){
if(this.value==''){
this.color="#000";
this.value="点我就消失";
onoff=true;
}
}

相关文章

kindeditor4.x代码高亮功能默认使用的是prettify插件,prett...
这一篇我将介绍如何让kindeditor4.x整合SyntaxHighlighter代...
js如何实现弹出form提交表单?(图文+视频)
js怎么获取复选框选中的值
js如何实现倒计时跳转页面
如何用js控制图片放大缩小