cuisine/scripts/fonctions.js
Timothée Huneau 4c71fb59b4 Initial commit
Création de tous les dossiers et fichiers avec mise à part des constantes
2023-04-11 19:11:26 +02:00

13 lines
No EOL
424 B
JavaScript

export var setEventSample = function(iRechercheIngredients, ldIngredients){
iRechercheIngredients.addEventListener('input', function (el, index, table){
Array.from(ldIngredients).forEach(function(el, index, ldIngredients){
if(RegExp("div-.*" + this.value, 'i').test(el.getAttribute('nom'))){
el.classList.remove('sample');
}
else{
el.classList.add("sample");
}
}, iRechercheIngredients);
});
};