0
500 li 's 목록에서 검색하고 있습니다. 다음 코드를 사용합니다. 그러나 두 가지 문제에 직면 해있다. 하나는 내가 뭔가를 입력 한 후 매우 빨리 backspace를 누르면 캡처되지 않습니다. 그리고 또한 검색은 내가 원하지 않는 대소 문자를 구분합니다.jquery를 사용하여 LI에서 검색
$('#find_question').bind("keyup", function() {
searchWord = $(this).val();
console.log("input length",searchWord);
if (searchWord.length >= 0) {
$('#leftSection li').each(function(i, data) {
text = $(this).text();
if (text.match(RegExp(searchWord, 'i')))
$(this).show();
else
$(this).hide();
});
}
});