设置搜索框的默认文字当鼠标单击时该默认文字消失

内容摘要
复制代码代码如下:
<input type="text" id="kword" name="kword" value="按项目名称搜索..." onfocus="if(this.value=='按项目名称搜索...')this.value='';" onblur="if(
文章正文

复制代码
代码如下:

<input type="text" id="kword" name="kword" value="按项目名称搜索..." onfocus="if(this.value=='按项目名称搜索...')this.value='';" onblur="if(this.value=='')this.value='按项目名称搜索...';" class="SmallInput" style="color:#A0A0A0;width:145px;">

代码注释

作者:喵哥笔记

IDC笔记

学的不仅是技术,更是梦想!