input添加文字 提示效果 点击后清空,移出时恢复提示

<input type="text" value="模糊型号查询" onfocus="if(value=='模糊型号查询') {value=''}" onblur="if (value=='') {value='模糊型号查询'}" name="keyword" size="30" style="color:#e5e1e1;"/>

 

<input type="text" value="联系人" onFocus="this.select();this.style.color='#000000'" onClick="if (this.value=='联系人'){this.value=''}" onblur="if(this.value ==''||this.value=='联系人'){this.value='联系人';this.style.color='#CCCCCC'}" style="width: 200px;color:#CCCCCC;" />

 

<input type="text" style="width:190px; height:16px; color:#DFDFDF" value="请输入笔记本的系列或者型号" onfocus="if(this.value=='请输入笔记本的系列或者型号'){this.value=''};this.style.color='black';" onblur="if(this.value==''||this.value=='请输入笔记本的系列或者型号'){this.value='请输入笔记本的系列或者型号';this.style.color='#DFDFDF';}">
    &nbsp;<input type="submit" name="search" value=" 搜 索 ">

posted @ 2013-10-09 17:05  打不死的信心  阅读(294)  评论(0)    收藏  举报