+ 2
Validation form checkbox JS
Hello, everyone! The checkbox validation doesn't work in my code. When agreement is not checked everything is okay, fields are red, added class error. But as I checked agreement, nothing is happening, class is still error and the fields is red. Please, I need your help! https://code.sololearn.com/W62xfOugew4j/?ref=app
2 Antworten
+ 2
You're getting the div with the id checkbox-mark, use this instead:
const agreement = document.querySelector('#input-checkbox');
That worked for me.
+ 2
Paul, it really works! Thank you very much! I am so happy 😊