jQuery :contains() selector uppercase and lower case issue

后端 未结 4 1585

My html looks like this





      
4条回答
  •  鱼传尺愫
    2020-11-27 14:42

    I don't believe there is a way to do this with a raw selector. The contains selector is case sensitive and there doesn't appear to be a case insensitive version. I think the best approach is to use a filter that manually queries the object

    var filt = function (unused) {
      $(this).text().toLowerCase().indexOf(txtSearch.toLowerCase()) !== -1;
    };
    

提交回复
热议问题