SetEventListeners Formez des entrées
const setEventListeners = (formElement) => {
// Find all fields inside the form, and
// make an array from them using the Array.from() method
const inputList = Array.from(formElement.querySelectorAll(".form__input"));
// Iterate over the resulting array
inputList.forEach((inputElement) => {
// add the input event handler to each field
inputElement.addEventListener("input", () => {
// Call the isValid() function inside the callback,
// and pass the form and the element to be checked to it
isValid(formElement, inputElement)
});
});
};
Cruel Cormorant