2013-06-30 93 views
0

我想让这个工作,但它没有。删除用CSS和jQuery输入图标

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

我想创建删除按钮,消除输入,也将把搜索列表

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

我不能管理让代码工作,例如重置搜索结果

回答

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

+0

它做我所需要的,非常感谢 – MOTIVECODEX