thanks to give me your time.
I actually coding a login page but i can't write form.addEventListener()
When i console.log(form)
it return null and i don't know why For the js side :
const form = document.getElementById("form");
console.log(form)
form.addEventListener('submit', (event) => {
event.preventDefault
console.log(event)
console.log(form)
})
For the html side :
[...]
<form id="form">
<label for="email"> Entrez votre Email : </label>
<input id="email" type="email" name="email" placeholder="Email ..." required>
<label for="mdp"> Entrez votre Mot de Passe : </label>
<input type="password" name="password" id="mdp" placeholder="Mot De Passe ..." required>
<input type="submit" name="envoyer" id="send" value="Se connecter">
</form>
[...]
thanks you if you read that !
I tried to change form, re try in another folder but nothing change
Via Active questions tagged javascript - Stack Overflow https://ift.tt/JdeyXA2
Comments
Post a Comment