Vérification des champs avant l'envoi
Page 27
const formElt = document.querySelector("form");
const firstPasswordElt = formElt.elements[0];
const secondPasswordElt = formElt.elements[1];
const firstPasswordInfoElt = document.getElementById("first_password_info");
const secondPasswordInfoElt = document.getElementById("second_password_info");
firstPasswordElt.addEventListener("input", firstPasswordCheck);
secondPasswordElt.addEventListener("input", secondPasswordCheck);
formElt.addEventListener("submit", submitFunction);
function firstPasswordCheck(event) {
console.log(event.target.value);
}
function secondPasswordCheck(event) {
console.log(event.target.value);
}
function submitFunction(event) {
}