• 搜索框里显示字段鼠标点击后就隐藏的方法


    我们可以看到一些织梦dedecms网站上的搜索框内有默认的字段,但我们鼠标点击后就没有了。

    我也想在我的网站的搜索框内实现这样的效果,于在网上搜寻一番,终于找到实现这一效果的方法。
     
    方法如下:https://www.xuanhe.net
     
    <input name="keyword" id="keyword" type="text" class="searchtxt"  size="20" value="探寻预留字" style="color:#ddd" onfocus="if (this.value=='探寻预留字')this.value=''" onblur="if (this.value=='')this.value='探寻预留字'" />
     
    Quote:
     
    <input name="keyword" id="keyword" type="text" class="searchtxt"  size="20" value="探寻预留字" style="color:#ddd" onfocus="if (this.value=='探寻预留字')this.value=''" onblur="if (this.value=='')this.value='探寻预留字'" />
     
     
    //解释onfocus="if (this.value=='探寻预留字')this.value=''"  当选中INPUT时候如果VALUE中的文字为 探寻预留字,则VALUE="",
     
    //onblur="if (this.value=='')this.value='探寻预留字'"  当焦点失去,如果搜索文本框INPUT 中无任何数据,则value='探寻预留字' 。
  • 相关阅读:
    final-第十章
    路由器基本配置-命令行配置模式
    路由器基本配置-对话配置模式
    配置静态路由
    默认路由
    像素值的读写
    矩阵的基本元素表达
    创建Mat对象
    Mat类
    数学基础-3D空间的位置表示
  • 原文地址:https://www.cnblogs.com/zqw111/p/13029965.html
Copyright © 2020-2023  润新知