javascript搜索框点击文字消失失焦时文本出现
当获焦时,文本消失,失焦时文本出现
<!doctypehtml>
<html>
<head>
<metacharset="utf-8">
<title>无标题文档</title>
</head>
<body>
<inputid="text"type="text"value="点我就消失"/>
<script>
varoText=document.getElementById("text");
varonoff=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;
}
}
</script>
</body>
</html>
热门推荐
10 小学同学简短祝福语
11 集体生日祝福语简短的
12 开锁祝福语简短走心
13 女士简短祝福语大全集
14 对公司年会祝福语简短
15 私房进火祝福语简短
16 金婚祝福语大全简短唯美
17 企业祝福语简短句子
18 过生日祝福语简短爸爸