Parcourez une liste pour voir s'il y a une correspondance pour les caractères entrés dans une boîte d'entrée
const menu_items = document.querySelectorAll('li');
function getInputValue() {
// Selecting the input element and get its value
var inputVal = document.getElementById("myInput").value;
menu_items.forEach(item => {
if (item.textContent.includes(inputVal)) {
console.log(inputVal + " is in the list.")
}
})
}
Meandering Meerkat