V
V
Vitaly Gusev2020-05-08 15:00:35
JavaScript
Vitaly Gusev, 2020-05-08 15:00:35

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

1 answer(s)
V
Vitaly Gusev, 2020-05-08
@guvijur

Unless it remains to allow input only in Latin characters.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question