Answer the question
In order to leave comments, you need to log in
How to do email input validation with JS and RegExp?
Comrades!
I can't figure out how to validate text input in a field. It doesn't even matter if it's mail or any other format (date, for example). I'm dumb and everything.
I want the background to be green with correct input, and with incorrect input, it will change to red and the incorrectly entered character will be deleted.
https://codepen.io/guvijur/pen/ExVEoYX
PS It dawned on me. It happens that you will rest against the horn and not in any. ).
I, the fool, compared the string with the regular expression, but it was necessary to compare the specifically entered character.
It's a shame. I fixed everything in the codepen, now it works fine there.
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