如何在输入普通字符时过滤土耳其字符? 当我想要过滤名称'GülayGül'时,它不会在我输入Gul时出现..等等。是否可以绕过jQuery?在输入字段上过滤土耳其字符
var item = $('.item');
$('input').keyup(function() {
var valThis = $(this).val().toLowerCase();
if (valThis == '') {
$(item).show();
} else {
$(item).each(function() {
var text = $(this).text().toLowerCase();
var match = text.indexOf(valThis);
if (match >= 0) {
$(this).show();
} else {
$(this).hide();
}
});
};
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<input type="text" placeholder="Search">
<div class="item">
<h3>John walker</h3>
</div>
<div class="item">
<h3>Michael Mayer</h3>
</div>
<div class="item">
<h3>Tim Jones</h3>
</div>
<div class="item">
<h3>Gülay Gül</h3>
</div>
我不能帮你,但我确实知道了jQuery自动完成构件具有该功能默认情况下建立,https://jqueryui.com/autocomplete/#folding – Vincent1989