Answer the question
In order to leave comments, you need to log in
How to catch input email html validation?
Hello everyone, can you tell me how to catch the standard html input validation type="email"
. Those. it can be allowed to catch it through e.target... when I enter the wrong mail format?
Answer the question
In order to leave comments, you need to log in
Of course they don't, but you can use pseudo-classes to check. For example, an invalid input has the :invalid pseudo-class , respectively:
// Выдаст 1, если заполнено неправильно:
document.querySelectorAll('input[type="email"]:invalid').length;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question