str.toLowerCase().indexOf(str.toLowerCase())>=0;

对字符串进行统一小写转换.

indexOf()查找到返回索引值大于=0;

未找到,返回-1;

input 输入框快速查找app

container.find('#searchName').keyup(function(){
var that = this;
var app = container.find('.pad-app');
$.each(app, function(idx, item){
$(item).hide();
});
var appname = container.find('.pad-app .pad-app-name');
$.each(appname, function(idx, item){
if($(item).html().toLowerCase().indexOf($(that).val().toLowerCase())>=0){
$(item).parent().show();
}
});
});

相关文章:

  • 2022-12-23
  • 2021-05-16
  • 2022-12-23
  • 2022-01-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-03
  • 2021-08-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案