使用css和jquery删除输入图标
我试图让这个工作,但事实并非如此。
我删除了我的代码以进行清理,这里是jsfiddle代码
我正在尝试创建删除按钮,删除输入,并重置搜索列表
----------------------- | | x | <- remove icon inside the input box ----------------------- or ----------------------- ---------- | | | All | <- all button outside the input box ----------------------- ----------
我无法让代码工作,例如重置搜索结果
不确定它是你在找什么…
使用HTML5输入类型搜索:
然后添加处理程序点击输入:
$('#input').on('click',function(){ if(this.value === "" ) //case when user reset the input by clicking button $(this).keyup(); });
DEMO