Jquery filter list without case sensitive

后端 未结 4 1105
忘掉有多难
忘掉有多难 2021-01-02 11:12

I want to filter the list without case sensitive. I want to match only character not match upper case or lower case.

  1. XXXXXXX
  2. yyyyyyy
  3. XXxxx
4条回答
  •  执念已碎
    2021-01-02 12:07

    Try this :

      function filter(element) {
            var value = $(element).val();
            $("#theList > li").hide();
            $("#theList > li:contains('" + value + "')").show();
        }
    

提交回复
热议问题