如何在輸入普通字符時過濾土耳其字符? 當我想要過濾名稱'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