How does js implement a general regular validation form method (minimum code)

1. How to implement a general regular validation form with the least amount of code

=
project, 1. Login has two input (verify mailbox, password 10 digits + letters)

   2.   input ()
   

both forms are displayed after input loses focus (correct or wrong message)

after input
Mar.01,2021
Menu