Last Updated : Jul 1, 2023
Here, as we know that email may contain
- Uppercase and lowercase alphabets
- Numeric digits
- Special characters like @
- And full stop with conditions like they are not first and last character of email address and not repeat continuously.
- For this first of all we here create a basic structure of html. For this we use html, head, title and body with script tag. We hope you know about the basic structure of html and which html tag is used for which concept.
- Here, we first see that we create a form inside body with input type text and a button to submit that data.
- Inside this function, we store our expression which we want in email address inside a variable. And match that format with text that user feed using if condition. Here, if the data submitted by user is valid. Then a message with text Email address valid displayed on screen otherwise if data does not matches then text having message you have entered an invalid email address, try again later executed.