Answer the question
In order to leave comments, you need to log in
What is causing the classList error?
const mail = document.querySelector('input[name="mail"]') as HTMLInputElement
mail.onblur = function() {
if (!mail.value.includes('@')) {
mail.classList.add('invalid');
mail_error.textContent = 'Пожалуйста, введите правильный email.'
}
};
mail.onfocus = function() {
if (this.classList.contains('invalid')) {
this.classList.remove('invalid');
mail_error.textContent = "";
}
}
this.classList.contains('invalid')
this.classList.remove('invalid')
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question