【问题标题】:remove icon for input with css and jquery使用 css 和 jquery 删除输入图标
【发布时间】:2013-06-27 16:26:13
【问题描述】:

我试图让它工作,但它没有。

我删除了我的清理代码,这里是jsfiddle code

我正在尝试创建删除输入并重置搜索列表的删除按钮

 -----------------------
|                  | x | <- remove icon inside the input box
 -----------------------     
or 
 ----------------------- ----------
|                      | | All    |  <- all button outside the input box
 ----------------------- ----------

我无法让代码正常工作,例如重置搜索结果

【问题讨论】:

    标签: jquery html search button input


    【解决方案1】:

    不确定是不是你要找的……

    使用 HTML5 输入类型搜索:

    <input class="search clearable" type="search" id="input"/>
    

    然后添加处理程序点击输入:

    $('#input').on('click',function(){
            if(this.value === "" ) //case when user reset the input by clicking button
                $(this).keyup();
        });
    

    DEMO

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-11-24
      • 2017-02-15
      • 2020-01-22
      • 2011-12-20
      • 1970-01-01
      • 2015-12-02
      相关资源
      最近更新 更多